Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 273 Bytes

File metadata and controls

11 lines (9 loc) · 273 Bytes

197. Rising Temperature

Self join to compare every two rows.
Use DATEDIFF to get the difference (in days) between the two dates.

SELECT b.id 
FROM Weather as a, Weather as b
WHERE DATEDIFF(b.recordDate, a.recordDate) = 1
AND a.temperature < b.temperature;