Questions tagged as 'sql'

4
answers

Performance of COUNT (*) and COUNT (1)

What is the difference between COUNT(1) and COUNT(*) in an SQL query. For example: SELECT COUNT(1) FROM USUARIOS; and SELECT COUNT(*) FROM USUARIOS; Is there any difference in interactions within SBGD? Which would...
asked by 20.06.2017 / 19:41
0
answers

problem with EntityFramework [closed]

See the return of the script, running mysql by sqlYog: ButwhenIruninVisualStudio,thereturnisdifferent: Serializedresult:"TotalMesAMes": [ { "mes": "January", "status": "Fechado", "valor_negocio": 1500 }, {...
asked by 03.11.2017 / 17:15
2
answers

join two tables with date condition [closed]

I need to join two tables, the first one presenting all the records contained in it, with the condition that what is in the second table has a lower price with data_ini and dt_fim using current_date to define if it is inside...
asked by 03.11.2017 / 17:03
1
answer

MSSQL How to find out which table a record was included or modified

Is there a way to find out via query which table in a database has changed Update or Insert?     
asked by 14.10.2017 / 18:20
1
answer

Linked SQL Server and FireBird: Error 'Must declare the scalar variable'

I made a linked of my SQLSERVER with FIREBIRD . But at the time I pass a variable inside the query to return the record amount I get the error:    Message 137, Level 15, State 1, Line 1 Must declare the scalar   variable "@QtdR...
asked by 11.10.2017 / 03:49
2
answers

Code 1215 in SQL "Can not add foreign key constraint"

When creating this code always comes the error:    1215 "Can not add foreign key constraint" I have tried everything, checked the foreign key constraints and nothing. Can someone help me? create table alunodisc ( codigodisc int,...
asked by 22.10.2017 / 13:29
0
answers

Trigger formatting date

create trigger tr_Fmt_Data before insert on Tempos for each row set new.Mes = date_format(new.Datas, "%M"); insert into Tempos (Datas) values("2017-10-03"); Would it be possible to help me complete the above trigger? I want to format the date...
asked by 04.10.2017 / 17:33
0
answers

Upload path with variable

I'm trying to use a "mutable" upload path. I made a bidding system, that with each new bid, a folder with the name of the same one will be created where the related files will be uploaded using mkdir (); but now I do not know how to send the fil...
asked by 02.10.2017 / 14:12
2
answers

How can I query the last deleted database procedure

Is it possible to check which was the last procedure deleted in the database? If so, how can I do this? The goal is to rebuild it.     
asked by 06.10.2017 / 19:33
2
answers

Deleting Duplicate Values in SQL

I have a problem with a query, because there is only one field that differs from one data to the other. I have tried to use group by , order by , having , I have researched in several forums, I have tried everything and I can n...
asked by 20.09.2017 / 16:13