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

Consecutive Numbers

Find all numbers that appear at least three times consecutively in the Logs table (consecutive by id). Return them in a column named ConsecutiveNums.

Table schema

Logs(id INT PRIMARY KEY, num INT)

Sample data

id | num
1 | 1
2 | 1
3 | 1
4 | 2
5 | 1
6 | 2
7 | 2

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.