Consecutive Numbers
Medium
Advanced Queries
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.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.