Last active
December 14, 2015 19:58
-
-
Save daleobrien/5140204 to your computer and use it in GitHub Desktop.
Postgresql SQL statement to generate a range of days between 2 dates
This file contains hidden or 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
SELECT | |
'2010-01-01'::DATE + day - 1 AS day | |
FROM | |
generate_series(1, '2011-01-01'::DATE - '2010-01-01'::DATE) AS day; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment