Two SQL solutions with join or sub clause


  • 0
    N

    #1800+ ms
    select id from Weather w where temperature>(select temperature from Weather
    where date = DATE_SUB(w.date,interval 1 day))

    #1232ms

      select w1.id from Weather w1,Weather w2 where w1.temperature>w2.temperature
     and datediff(w1.date,w2.date)=1

Log in to reply
 

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