Reputation: 2592
Found this but this doesn't run on standard SQL
I tried to do:
WHERE datew > DATE_SUB(CURRENT_TIMESTAMP(),INTERVAL 5 DAY )
But this doesn't work. According to the docs DATE_SUB
supports only
DAY
WEEK. Equivalent to 7 DAYs.
MONTH
QUARTER
YEAR
How can I get current time stamp - 15 minutes
on standard SQL with BigQuery?
Upvotes: 1
Views: 9487
Reputation: 1329
Check out timestamp_sub() function.
How to use it:
SELECT
CURRENT_TIMESTAMP() AS now,
TIMESTAMP_SUB(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE) AS ago_15_min
Results
Upvotes: 8