Contiguous Date Ranges
Hard
Gaps and Islands
Given a list of distinct dates, group consecutive dates into ranges and return start_date and end_date of each range, ordered by start_date.
Table schema
Dates(d DATE PRIMARY KEY)Sample data
d
2026-01-01
2026-01-02
2026-01-03
2026-01-05
2026-01-07
2026-01-08
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.