Skip to content

Commit 9ea9a94

Browse files
authored
Create 180-consecutive-numbers.sql
1 parent 9333a22 commit 9ea9a94

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

180-consecutive-numbers.sql

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Write your MySQL query statement below
2+
SELECT DISTINCT
3+
l1.Num AS ConsecutiveNums
4+
FROM
5+
Logs l1,
6+
Logs l2,
7+
Logs l3
8+
WHERE
9+
l1.Id = l2.Id - 1
10+
AND l2.Id = l3.Id - 1
11+
AND l1.Num = l2.Num
12+
AND l2.Num = l3.Num
13+
;

0 commit comments

Comments
 (0)