SELECT id AS ConsecutiveNums FROM ( SELECT id, num, LEAD(num,1) OVER (ORDER BY id) AS two_num, LEAD(num,2) OVER (ORDER BY id) AS three_num FROM Logs) sub WHERE num=two_num AND two_num=three_num