欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

LeetCode刷题之数据库-180. 连续出现的数字(难度-中等)

程序员文章站 2022-06-11 18:43:31
...

180. 连续出现的数字

目录

1. 题目

2. 解题


leetcode链接

1. 题目

LeetCode刷题之数据库-180. 连续出现的数字(难度-中等)

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;

 

相关标签: 笔记 MySQL