0
I made this select that returns me the amount of records in the last 24 hours
select count(*) from registros
where registry_date >= NOW() - interval '24 hours'
I need a select to compare the value that is returned in this first query with the value of the same date in the previous month.
Example: Today (10/10/2018) were 90 records. I need to compare these 90 records with the number of records of the day 10/09/2018
CURRENT_DATE - interval '1 Month' provides the date of the previous month.
– anonimo
@Programmer takes a look at my answer..
– rLinhares
Do you need to return the two values in the same query or just one? Ex: return two lines one with the date 10/10/2018 and 90 records and the other 10/09/2018 and the amount of records?
– Wel