Questions tagged as 'sql'

1
answer

query optimization that adds values according to a clause

Hi. I have a query that should bring two columns, one of the columns will return the value of one column, plus the sum of another column respecting the where clause to add the values. I came to find the result that serves me as follows:...
asked by 03.08.2015 / 17:22
3
answers

Inserting column in Oracle table with conditional

I need to create a column in an existing table but need to do with a check condition if this column already exists in the database I did this way however it throws an error: DECLARE col_count integer; BEGIN SELECT count(*) into col_count F...
asked by 08.04.2015 / 19:38
2
answers

Error while executing project in Visual Studio

When I run a project in Visual Studio it has the following error:    A first chance exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Code using System; using System.Collections.Generic; using System.Com...
asked by 25.03.2015 / 20:32
1
answer

Add restriction MYSQL

I'm using the following query: $sql = "SELECT * FROM 'login' order by 'account_id' ASC"; How do I add a constraint when account_id is equal to 1 it "jumps" and does not catch the values of the line with account_id = 1?     
asked by 25.03.2015 / 13:32
1
answer

Select deleting another Select

Well my scenario is as follows, I have 1 slide where shows the last 4 news SELECT * FROM noticias WHERE destacar='Destacado' ORDER BY idnoticia DESC LIMIT 4 Under the slide I have a list of the other subjects where you should present the on...
asked by 02.04.2015 / 02:52
1
answer

Add Arrays with php

I'm not sure what I want to do, but I'm not sure how to do this. Array ( [0] => Array ( [0] => Array ( [i_chamada] => 1...
asked by 02.04.2015 / 15:00
1
answer

Show products by category parameter in a more optimized way

Good evening! Well, I'll explain what I'm trying to do. I have here a table in my database that corresponds to the products and I have a page that shows these products. It turns out that one of the parameters of this table refers to the cate...
asked by 05.04.2015 / 23:33
1
answer

List table data and assign value to each table (SQL)

Good morning! I would like to know how I do to list the data in a table and assign value to each of them! Example: Table: character Columns: ID and name I would like to get all the names that have the same id, and list them on a page each...
asked by 08.03.2015 / 13:26
1
answer

Update the database by SQL PHP

Personal I'm having difficulty updating my database to decrease the weight by 1 kg. Any help I appreciate. The code is as follows: <?php class Aluno{ public $nome; public $endereco; public $peso; public $...
asked by 09.03.2015 / 13:46
1
answer

Error Code: 1048, SQL State: 23000 Column 'colegiado_id' can not be null

Hello, this error "[Error Code: 1048, SQL State: 23000] Column 'colegiado_id' cannot be null" It happens when I try to run the SQL command below directly in MySQL: start transaction; INSERT INTO EspecialistasColegiados (colegiado_id, esp...
asked by 04.03.2015 / 22:06