MySQL Forums
Forum List  »  Newbie

Re: Error on join
Posted by: Peter Brawley
Date: April 26, 2022 06:13AM

No need for the CTE ...

select 
  w1.id, w1.recordDate as d1, w1.temperature as t1,
  w2.id, w2.recordDate as d2, w2.temperature as t2
from Weather w1
join weather w2 on datediff(w2.recorddate, w1.recorddate)=1
                and w2.temperature > w1.temperature;

Options: ReplyQuote


Subject
Written By
Posted
April 25, 2022 08:58PM
Re: Error on join
April 26, 2022 06:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.