Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Easy/00197-rising-temperature.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
-- current temp should be greater than previous temp
-- we want output that satisfies all these conditions, hence putting everything in 'ON' clause. we can filter data using WHERE as well

select w1.id as Id
from Weather w1 inner join Weather w2 on datediff(w1.recordDate, w2.recordDate) = 1 and w1.temperature > w2.temperature
SELECT w1.id
FROM Weather w1
INNER JOIN Weather w2
ON DATEDIFF(w1.recordDate, w2.recordDate) = 1
AND w1.temperature > w2.temperature;

-- google- 3
-- adobe- 2
Expand Down