Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Contiguous Date Ranges

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.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.