Questions tagged as 'sql'

1
answer

Queries sending data to another table [closed]

Hello, I'm in need of some help getting data using where to move to another table: link (table of accounts) In the print, it shows the "UserID (int)" I need to get all the "UserID (int)" using where link in this print shows the table w...
asked by 19.10.2016 / 06:30
1
answer

Pass a subquery from the FROM clause to the WHERE clause [duplicate]

I have the following query with a subquery in the FROM clause and I want to get the same result but using this subquery in the WHERE clause. SELECT base.nome as Aquario, base.localizacao, base.nome_cientifico F...
asked by 07.12.2016 / 23:22
1
answer

I can not save the [closed]

Every time I click on the program, send it to me internal void Insert(int p, string p_2, string p_3, int p_4, string p_5, System.Drawing.Image image, string p_6) { throw new System.NotImplementedException(); } Bu...
asked by 04.01.2018 / 03:05
1
answer

PDO query error

I have the following code: @$import = $dbconn->prepare("UPDATE t SET"); if(a <> "") { $import .= "teste2= '$a', teste= '$b', "; ... It returns this error: Catchable fatal error: Object of class PDOStatement could not be convert...
asked by 27.11.2018 / 16:25
3
answers

INNER JOIN is duplicating record [closed]

I have an INNER JOIN that is duplicating records in the view. Because in the database such records are not duplicates. select conta.dominio, conta.id, conta.modelo, imoveis.id, imoveis.cod, imoveis.titulo, imoveis.vvenda, imoveis.vtem...
asked by 23.02.2016 / 15:55
1
answer

SQL error while trying to make an UPDATE with PHP [closed]

public function AlterarDoador(ClasseDoador $AlterarDoador) { try { $pdo = conexao::getInstance(); $sql = "UPDATE doador SET nome=?,cpf=?,datadenascimento=?" . "sexo=?,endereco=?,complemento=?,ba...
asked by 24.06.2016 / 19:35
2
answers

co-pilots who made the largest number of flights [closed]

I have this question: Name and number of flight hours of co-pilots who have flown the most flights. It is intended to know the exact number of flights made by each of these co-pilots And I tried to solve it like this: SELECT t.nome , p1....
asked by 09.12.2015 / 18:08
2
answers

join tables in sql without primary keys or foreign keys common to the 2 tables

I have to do a SQL query on several tables. I need to relate the two through a common "id" but I do not know how I do not have declared primary keys or foreign keys. Follow the code snippet: SELECT a.iban, TO_CHAR(date_, 'month ,yyyy-dd'...
asked by 28.11.2017 / 18:09
1
answer

My SQL Error 1215: Can not add foreign key constraint!

Well when I'm adding the references it gives this error, the error appears from the 3rd alter table that I do! create database tipoUber_bd; use tipoUber_bd; create table users( CPFUsuario char(11), NomeUsuario varchar(30),...
asked by 15.07.2018 / 07:47
1
answer

Pick 1 record per date without repeating the date

I have a box system where every time the box is opened and closed per day is registered in the table, the box is opened and closed several times a day, however I would like to only pick up the first opening of the day and with that list the last...
asked by 13.06.2018 / 16:25