好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

题目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   

查看更多关于题目5:MySQL----------Consecutive Numbers的详细内容...

  阅读:24次