Skip to content

Instantly share code, notes, and snippets.

@barsbek
Created March 17, 2018 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barsbek/3f9db18f4b15005767d9c8e604d7b8d0 to your computer and use it in GitHub Desktop.
Save barsbek/3f9db18f4b15005767d9c8e604d7b8d0 to your computer and use it in GitHub Desktop.
postgresql: generate a series of values
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