Generate Series Of Numbers
Postgres has a generate_series
function that can be used to, well, generate a series of something. The simplest way to use it is by giving it start
and stop
arguments
The default step is 1, so if you want to count backwards, you need to specify a negative step
You can use a larger step value to, for instance, get only multiples of 3
Trying this out with timestamps is left as an exercise for the reader.
Last updated