Created
March 17, 2018 17:46
-
-
Save barsbek/3f9db18f4b15005767d9c8e604d7b8d0 to your computer and use it in GitHub Desktop.
postgresql: generate a series of values
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
select generate_series('2016-12-31'::date, '2017-02-03'::date, '2 days'); -- series of days with interval of 2 days | |
select generate_series(1, 5, 2); -- 1, 3, 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment