How To Create Date Series in SQL

Advanced SQL challenge on how to generate a time series in Postgres or RedShift.

Olga Berezovsky
Data Analysis Journal
3 min readSep 10, 2021

--

Let’s say you have a task to make a histogram or a timeline of DAU (Daily Active Users) or users who purchased or subscribed daily, or any graph based on date values:

From R-Graph-Gallery

You’d need to prepare the data in the following format that would have a date and…

--

--