180. Consecutive Numbers ¶ SQL 1 2 3 4 5 6 7 8 9 10 11 12 13WITH LogsNeighbors AS ( SELECT *, LAG(num) OVER(ORDER BY id) AS prev_num, LEAD(num) OVER(ORDER BY id) AS next_num FROM LOGS ) SELECT DISTINCT num AS ConsecutiveNums FROM LogsNeighbors WHERE num = prev_num AND num = next_num;