I'm trying to get a query that filters the date from the last 24 hours:
select *
from tb
where created_at > DATEADD('hour', -24, now())
limit 100;
But I'm getting this error:
SYNTAX_ERROR: line 3:24: Function dateadd not registered
I'm trying to get a query that filters the date from the last 24 hours:
select *
from tb
where created_at > DATEADD('hour', -24, now())
limit 100;
But I'm getting this error:
SYNTAX_ERROR: line 3:24: Function dateadd not registered
It's ok, just the function name is wrong, it should be date_add
Docs: https://prestodb.io/docs/current/functions/datetime.html
I don't think DATEADD is a postgres function, you could try this:
select *
from tb
where created_at > (now() - 24 * '1 hour')
limit 100;