输入banner图图片脚本导航/分类

题目5:MySQL----------Consecutive Numbers

# Write your MySQL query statement below
select distinct Num from (
    select
        Num,
        case
            when @prevNum = Num then @count := @count + 1
            when (@prevNum := Num) is not null then @count := 1
        end n
    from Logs, (select @prevNum := NULL) r
    order by Id
) a where n >= 3



题目5:MySQL----------Consecutive Numbers

标签:mysql   database   consecutive numbers