Leetcode 180. 连续出现的数字(多表连接)

2021-04-01 17:01:14 浏览数 (1)

代码语言:javascript复制
select distinct l1.Num as ConsecutiveNums
    from Logs l1,Logs l2,Logs l3
    where l1.id=l2.id-1
    and l2.id=l3.id-1
    and l1.Num=l2.Num
    and l2.Num=l3.Num

0 人点赞