Skip to content

Instantly share code, notes, and snippets.

@ziadoz
Last active May 22, 2023 14:58
Embed
What would you like to do?
MySQL Select 15 Minute Time Series
with recursive 15min_windows as (
select
curdate() + interval 8 hour as start,
curdate() + interval 8 hour + interval 15 minute as end
union
select
end,
end + interval 15 minute
from 15min_windows
where end < curdate() + interval 16 hour
)
select * from 15min_windows;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment