The convenience BI tools provide is that our SQL queries become “live” – our dashboards will always show us the data relative to the present moment. Like “Signups last 24h” or “Revenue last 30days”. The same applies for the alarms.
Such relativity is possible thanks to the now()
function, which returns the current timestamp. Try it:
SELECT now()
Some SQL databases have a different name for that function, for example Redshift has the getdate()
function instead of now()
.
Signups in the past month
Here’s the query that counts signups for the past...