MySQL Select 15 Minute Time Series
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 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