Consecutive Numbers
문제
코드
Oracle
SELECT DISTINCT L.NUM AS ConsecutiveNums
FROM LOGS L
INNER JOIN LOGS F ON L.ID + 1 = F.ID
INNER JOIN LOGS S ON L.ID + 2 = S.ID
WHERE L.NUM = F.NUM
AND L.NUM = S.NUM
SELECT DISTINCT L.NUM AS ConsecutiveNums
FROM LOGS L
INNER JOIN LOGS F ON L.ID + 1 = F.ID
INNER JOIN LOGS S ON L.ID + 2 = S.ID
WHERE L.NUM = F.NUM
AND L.NUM = S.NUM