180. 连续出现的数字 + MySql + 连续出现数字 + 多表联合查询

180. 连续出现的数字

LeetCode_MySql_180

题目描述

代码实现

# Write your MySQL query statement below
select distinct
    t1.num as ConsecutiveNums
from 
    Logs t1,
    Logs t2,
    Logs t3
where
    t1.Id = t2.Id + 1
    and t2.Id = t3.Id +1
    and t1.Num = t2.Num
    and t2.Num = t3.Num;

posted @ 2021-03-02 10:46  Garrett_Wale  阅读(77)  评论(0编辑  收藏  举报