Skip to content

Commit 5df7460

Browse files
committed
task: #197
1 parent e931618 commit 5df7460

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Have a good contributing!
3939
- [182. Duplicate Emails](./leetcode/easy/182.%20Duplicate%20Emails.sql)
4040
- [183. Customers Who Never Order](./leetcode/easy/183.%20Customers%20Who%20Never%20Order.sql)
4141
- [196. Delete Duplicate Emails](./leetcode/easy/196.%20Delete%20Duplicate%20Emails.sql)
42+
- [197. Rising Temperature](./leetcode/easy/197.%20Rising%20Temperature.sql)
4243
- [511. Game Play Analysis 1](./leetcode/easy/511.%20Game%20Play%20Analysis%201.sql)
4344
- [577. Employee Bonus](./leetcode/easy/577.%20Employee%20Bonus.sql)
4445
- [586. Customer Placing the Largest Number of Orders](./leetcode/easy/586.%20Customer%20Placing%20the%20Largest%20Number%20of%20Orders.sql)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
Question 197. Rising Temperature
3+
Link: https://leetcode.com/problems/rising-temperature/description/?source=submission-noac
4+
5+
Table: Weather
6+
7+
+---------------+---------+
8+
| Column Name | Type |
9+
+---------------+---------+
10+
| id | int |
11+
| recordDate | date |
12+
| temperature | int |
13+
+---------------+---------+
14+
id is the column with unique values for this table.
15+
There are no different rows with the same recordDate.
16+
This table contains information about the temperature on a certain day.
17+
18+
19+
Write a solution to find all dates' id with higher temperatures compared to its previous dates (yesterday).
20+
21+
Return the result table in any order.
22+
*/
23+
24+
SELECT w1.id
25+
FROM Weather AS w1
26+
LEFT JOIN
27+
Weather AS w2
28+
ON w1.recordDate = w2.recordDate + INTERVAL '1 day'
29+
WHERE w1.temperature > w2.temperature

0 commit comments

Comments
 (0)