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

Gaps in Sequential IDs

Return the missing ids in a table whose ids should run from the minimum to the maximum without gaps. Return them ordered ascending in a column named missing_id.

Table schema

Tickets(id INT PRIMARY KEY)

Sample data

id
1
2
4
7

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.