Is there a easy way to get the data with timestamp == yesterday?
I just want the data of yesterday.
SELECT
 COUNT(t0.user_id) AS t0_qt_AC5uO9oi
FROM
 `{something here}` AS t0
WHERE
 (t0.event_type = 'XXXXX')
ORDER BY
 t0_qt_AC5uO9oi ASC;
Not sure what is the best way.
Below is for BigQuery Standard SQL
#standardSQL
SELECT 
  CURRENT_DATE() today, 
  DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY) yesterday   
Assuming that you are asking for how to get yesterday's date!
Then of course you need to use it in your query respectively   
for example
WHERE t0.event_date = DATE_ADD(CURRENT_DATE(), INTERVAL -1 DAY)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With