SQL | Consecutive Numbers, Product Price at a Given Date
https://leetcode.com/problems/consecutive-numbers/description/Consecutive Numbers# 연속해서 3번 이상 나온 숫자WITH a AS( SELECT *, # 바로 다음 행의 위치 LEAD(num, 1) OVER(ORDER BY id, num) AS num1, # 다음 다음 행의 위치 LEAD(num, 2) OVER(ORDER BY id, num) AS num2 FROM Logs)SELECT DISTINCT num AS ConsecutiveNumsFROM aWHERE (num = num1) AND (num = num2) # 바로 다음과 다..