Whats wrong with my Query ?


  • 0
    C

    select T.Id from Weather as T,Weather as S where (T.Date=S.Date+1) and (T.Temperature>S.Temperature);


  • -6
    P

    it wont work if the dates differ by more than 1 day


  • 1
    T

    Use DATE_SUB and DATE_ADD for date operations. For example: T.Date = DATE_ADD(S.Date, INTERVAL 1 DAY); Sorry the display of the functions is not what I expect in my reply.


Log in to reply
 

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