Skip to content

Instantly share code, notes, and snippets.

@easternnl
Created March 2, 2020 08:21
Show Gist options
  • Save easternnl/93dfb2699f5ab27924dcaed83140134d to your computer and use it in GitHub Desktop.
Save easternnl/93dfb2699f5ab27924dcaed83140134d to your computer and use it in GitHub Desktop.
SQLite DateTime table with min and max
WITH RECURSIVE dates(datetime) AS (
VALUES('2015-10-03 08:00:00')
UNION ALL
SELECT datetime(datetime, '+1 second')
FROM dates
WHERE datetime < '2015-10-03 10:00'
)
SELECT datetime FROM dates;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment