Questions tagged as 'sql'

3
answers

How to bring salespeople who did and did not make sales yesterday?

In this select I am bringing all the employees who accessed the application yesterday PO.DAT_COLETA and who performed yesterday PE.COD_PEDIDO . But I also want to bring those who accessed yesterday and did not make sales, today I do...
asked by 02.02.2017 / 13:01
1
answer

Sort records containing numbers at the end

I have a table with the following records: +----+------------+--------------+ | id | title | url | +----+------------+--------------+ | 1 | Olá Mundo! | ola-mundo-1 | | 5 | Olá Mundo! | ola-mundo-3 | | 6 | Olá Mundo! | ola-m...
asked by 14.02.2017 / 07:37
2
answers

How to filter records by date using SQL

I am using SQL Server and need to query on a table the latest price record according to the date. Of all the records, I need him to bring me only 1 and with the current date. How do I do this?     
asked by 20.12.2018 / 13:58
1
answer

ERROR SYNTAX WHERE - PHP

I have the following code in php: $sql = "SELECT * FROM musicas_curtidas GROUP BY musica ORDER BY count(musica) WHERE musica != 'Rádio Turn - Você em primeiro lugar!' AND WHERE musica != 'Radio Turn - Não importa o seu estil...
asked by 10.01.2017 / 02:33
2
answers

Doubt with group by for last record

I want to make a select that brings the data of note of each student, grouped by student and matter, but I want only the result of the last test of each matter. For example a student can take the English test 3 times, and math twice, in t...
asked by 12.12.2016 / 15:11
1
answer

How to average in SQL?

I have a job to do where I enter name and two notes into a database using VoiceXML. I have two tables, one with nome , notaum , notadois and another with nome , media . How do I calculate the average of notaum...
asked by 13.12.2016 / 15:15
2
answers

Problem with IN condition in the sub-select

I have the following problem; I'm trying to do a search and include the value of the WHERE principal in a sub-select , however the result is always reported as 0, Part of the query I'm having difficulties is this: SELECT (...
asked by 21.11.2016 / 20:14
2
answers

How to do a record count for each day between one date and another?

I need to make an appointment, to return the number of registrations registered in EVERY DAY, between two dates. I'm using a MYSQL database, and I tried it here, but no form seemed to me correct.     
asked by 14.06.2016 / 16:45
1
answer

What is the number of decimal places of type NUMBER (12,2)?

How do I know the number of decimal places for type NUMBER (12, 2) in an Oracle database? V_FATURA NUMBER(12, 2)     
asked by 01.06.2018 / 16:28
1
answer

where condition increasing

I have a table called users and I want to get some users according to the id so I am doing this: select * from usuarios where id=2; I just want to get several users with different ids, for example get users who have the id 2,8,10,11,20 at o...
asked by 27.02.2016 / 18:33