Making a Table of Dates (Date List) in MySQL

Song Joyce Park
2 min readMay 7, 2023

While not quite as pretty as BigQuery’s solution to making date lists, it is possible to make something similar with MySQL. The caveat being that this particular solution requires using a CTE, so it will only work from MySQL version 8.0…!

Solution

The solution is to use a recursive CTE (common table expression) and union dates.

--

--

Song Joyce Park

Data Analyst turned Product Manager. New Yorker turned Seoulite.