Questions tagged as 'sql'

2
answers

Condition in join or in where?

Is there a difference if I use: select * from a left join b on a.id = b.id and b.id2=1 where ... or select * from a left join b on a.id = b.id where b.id2=1 Sent on: Fri ? The first SQL returned me super fast, the second one did...
asked by 30.08.2016 / 13:52
2
answers

SQL LIKE is Case Sensitive?

When I had this doubt, I did not find quick results in Portuguese that offered a response (most of the results are in StackOverflow in English). It would be interesting to have an objective answer here in Portuguese to help the community....
asked by 23.03.2017 / 16:46
2
answers

Brazilian Time Zone in MySQL

I have a MySQL database table named registros . In it, I have the following structure: id_registro , nome_registro , data_registro . In data_registro I'm using current_timestamp (), fetching the time from th...
asked by 08.09.2016 / 17:02
2
answers

How to get random results in SQL with different SGDBs?

Based on this existent question in SOen and wanting to bring interesting and useful content to SOpt I ask this question: How to get random results in SQL with different SGDBs?    I'm leaving a ready answer, but I'm going to leave it open...
asked by 26.04.2018 / 17:47
1
answer

Error converting varchar value to integer

When performing the following UPDATE through my API (.NET Core): UPDATE Aula SET WHATEVER = WHATEVER WHERE ID_AULA = @examID Code: string query = builder .AppendLine("UPDATE Aula") .AppendLine("SET WHATEVER = WHATEVER")...
asked by 10.05.2018 / 18:47
1
answer

select with limit on firebird

I do in mysql to search the last 1000 regitros: select * from tabela order by id desc limit 1000; Now, how do you do this in Firebird? This way I get the following error message:    Dynamic SQL Error   -SQL error code = @ 1   -Token...
asked by 20.05.2015 / 22:07
1
answer

What is the best way to insert with SQL?

I say this because there are two ways, so I understood. You have the: INSERT INTO teste SET nome = "Lucas", sobrenome = "Alves"; And also the way: INSERT INTO teste (nome, sobrenome) VALUES ("Lucas", "Alves"); Question of speed, goo...
asked by 03.09.2017 / 04:57
1
answer

Database Indexing [closed]

What is the advantage of maintaining an indexed database, with foreign key and indexing of the most used fields as in searches?     
asked by 14.05.2015 / 13:02
1
answer

SQL command return [duplicate]

I need to select in my database all printers that are compatible with a particular selected supply, for example, the 155 code supply that is called 50FOZ00 . I make the query below to select all supported printers: SELECT supriment...
asked by 02.08.2017 / 14:27
1
answer

What is the difference between the MySQL Trigger exception and MySQL Event?

I would like to create an Email trigger scheduler , if possible, without using cron , and would like to know if you can do this through MySQL >. Searching the Internet I've seen some examples of creating a non-cron event : CREATE...
asked by 14.12.2015 / 13:38