LeetCode刷题之数据库-180. 连续出现的数字(难度-中等)
程序员文章站
2022-06-11 18:43:31
...
180. 连续出现的数字
目录
1. 题目
2. 解题
# Write your MySQL query statement below
select DISTINCT
l1.Num as ConsecutiveNums
from
Logs l1,
Logs l2,
Logs l3
where
l1.Id+1=l2.Id
and l2.Id+1=l3.Id
and l1.Num = l2.Num
and l2.Num = l3.Num;
上一篇: 【数据库】 180. 连续出现的数字