Created
December 6, 2012 09:44
-
-
Save certainty/4223296 to your computer and use it in GitHub Desktop.
sql
This file contains 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 characters
WITH RECURSIVE dates as | |
( SELECT NOW() AS day | |
UNION ALL | |
SELECT day + interval '1 day' | |
FROM dates | |
WHERE day + interval '1 day' <= '2012-12-24' | |
) | |
SELECT day FROM dates | |
LEFT OUTER JOIN DailyData ON dates.day = DailyData.date | |
WHERE DailyData.id IS NULL | |
ORDER BY dates.day ASC | |
LIMIT 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment