1. 程式人生 > >【leetcode刷題】mysql題庫

【leetcode刷題】mysql題庫

enum mage png urn 輸出 lec leetcode statement html

IFNULL(exp1, exp2)

如果存在exp1則展示exp1,如果沒有輸出exp2

cast

convert

技術分享圖片

# Write your MySQL query statement below
select DISTINCT
Num as ConsecutiveNums
from
(
select
Num,
( CASE WHEN Num = @curNum THEN @counter := @counter + 1 WHEN @curNum :=Num THEN @counter := 1 END ) as counter
from

Logs,
( select @curNum := NULL, @counter := 0 ) as q
) as a
where
counter >= 3

https://www.cnblogs.com/dannylinux/articles/8288790.html

【leetcode刷題】mysql題庫