Contents

Consecutive Numbers

   Mar 26, 2023     0 min read

Consecutive Numbers

문제

180-1.jpg
180-2.jpg

코드

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

수행결과

180result.jpg