What's wrong with this presto query?

Viewed 1240

select * from table1 where created_at > date_sub(NOW(), interval 1 day)

I'm trying to get everything created within the last day, but I'm getting this error: mismatched input '1'. Expecting: ',', " What am I doing wrong here?

1 Answers

date_sub is a MySQL specific function. In Presto there are other time interval functions. I suppose your query should be something like that:

select * from table1 where created_at > date_add('day', -1, now()); 

However I don't have any Presto instance to test it.

Related