Questions tagged as 'sql'

3
answers

How to optimize SQL to filter results

The filter may occur in the following scenarios: No% of% completed 1 (one) input filled Combinations of input , including all SQL to be optimized: $cnpj = isset($_GET['cnpj']) ? $_GET['cnpj'] : $_POST['cnpj'];...
asked by 25.02.2017 / 01:24
4
answers

SQL Conditional Count

I have the following table +----------+----------+ | data | valor | +----------+----------+ | 16/05/15 | 1 | | 16/05/15 | 0 | | 16/05/15 | 1 | | 16/05/15 | 0 | | 17/05/15 | 2 | | 17/05/15 | 1 |...
asked by 20.01.2017 / 13:57
3
answers

Error in POSTGRESQL Bank Creation

I'm having the following error when creating a POSTGRESQL database: SQL CODE: CREATE DATABASE pesadaum; CREATE TABLE user( user_id int PRIMARY KEY NOT NULL AUTO_INCREMENT, email varchar(255) NOT NULL, heavy_pass varchar(...
asked by 08.06.2016 / 14:43
1
answer

DELETE in SQL does not execute

I'm trying to delete rows from a SQL Express database, but unfortunately I can not do it. The query is one of those same basic ones, but once I run it I get the ' executing query' message in SQL Server Management Studio indefinitely, but it neve...
asked by 25.09.2017 / 12:18
2
answers

Search with Inner join [closed]

I'm doing a search where the user enters the order ID and the system does return the request's observation, product code and qtd. And these data are arranged in 2 tables. (I did not create the bank, it already came ready) However, with my query...
asked by 20.10.2017 / 20:26
2
answers

Error with ID AUTO_INCREMENT [closed]

My problem is to leave the first INSERT field empty, (if I fill in the program), in my phpmyadmin the ID field is AUTO_INCREMENT, but without modifying that part of the code, it stopped. Code: $sql = "INSERT INTO usuarios VALUES ('','$user'...
asked by 20.12.2016 / 01:30
2
answers

Make the primary key duplicable

When I insert the data into my SQL table everything is normal. However, when trying to insert a second time, with the same value in id that is the main field of the table, it returns the following error: Duplcate entry '156' for ke...
asked by 09.04.2015 / 22:39
2
answers

How to insert selecting from two different tables?

TABELA 1 - ID - IMOVEL - CODIGO - IMAGEM_G <----- nessa tabela este dado é vazio. - IMAGEM_P TABELA 2 - ID - IMOVEL <----- nessa tabela este dado é vazio. - CODIGO <----- nessa tabela este dado é vazio. - IMAGEM_G - IMAGEM_P I...
asked by 19.01.2015 / 19:09
3
answers

Field with Cedilla in Mysql

I have a field in my database table MySql with the name 'description', with special accents. My problem is: When I make a INSERT INTO directly using phpMyAdmin , it normally inserts the information into the table, but when using my...
asked by 11.05.2017 / 19:16
1
answer

Generate bank script with structure and data

Backup is no way to do, because it depends on the permission of France and so on. So the solution we found here was to try to generate a script that copies not only the structure of the tables, this I already do and did, but type an INSERT loadi...
asked by 27.04.2017 / 23:09