In large modern databases you usually have a function available called generate_series that is useful for creating an inline series numbers, dates, etc
Example
SELECT * FROM generate_series(2,4);
Produces the results of
generate_series
-----------------
2
3
4
You can also combine this with dates and date