Leetcode:連續出現的數字

https://leetcode-cn.com/problems/consecutive-numbers/

select distinct 
    t1.Num as ConsecutiveNums 
from 
    Logs t1,Logs t2,Logs t3 
where 
    t1.Id = t2.Id+1 and 
    t2.Id = t3.Id+1 and 
    t1.Num = t2.Num and 
    t2.Num = t3.Num;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章