Created
October 22, 2022 16:24
-
-
Save samyakrt/5a79712e0e22d989a0a9c7c73dfc05ba to your computer and use it in GitHub Desktop.
Revisions
-
samyakrt created this gist
Oct 22, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ WITH RECURSIVE dates_without_gaps(month) AS ( SELECT DATE_SUB('2022-10-15', INTERVAL 1 YEAR) as month UNION ALL SELECT DATE_ADD(month, INTERVAL 1 MONTH) as month FROM dates_without_gaps WHERE month < '2022-10-15' )