Consecutive Numbers https://leetcode.com/problems/consecutive-numbers/ # 최소 3번이상 연속적으로 나타나는 숫자 찾기 # 순서는 상관없음 SELECT DISTINCT l.num AS ConsecutiveNums -- 중복제거 FROM logs AS l INNER JOIN logs AS l_next ON l.id + 1 = l_next.id INNER JOIN logs AS l_next2 ON l.id + 2 = l_next2.id # three times consecutively WHERE l.num = l_next.num AND l_next.num = l_next2.num