Last active
March 12, 2018 16:21
-
-
Save infinex/88de4b0659cf10b88518c91a2c37c29c to your computer and use it in GitHub Desktop.
big query date generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#standard sql | |
#https://stackoverflow.com/questions/38929121/duplicating-records-to-fill-gap-between-dates-in-google-bigquery | |
SELECT day | |
FROM UNNEST( | |
GENERATE_DATE_ARRAY( | |
DATE_TRUNC(DATE_SUB(CURRENT_DATE,INTERVAL 1 YEAR),MONTH) | |
, CURRENT_DATE(), INTERVAL 1 DAY) | |
) AS day |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment