Help! Time Exceeds


  • 0
    J

    Below is my code and I think it should be working fine. Any idea how to improve it? Thanks!

    select b.Num Num2 FROM log as a left join log b on a.Num = b.Num and b.Id = a.Id + 1 having count(Num2) > 2;


  • 0
    I

    You should join three table, not just 2


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.