Skip to content

Commit c72237b

Browse files
committedMar 14, 2022
feat: add sql solution to lc problems: No.0197
No.0197.Rising Temperature
1 parent ac66f50 commit c72237b

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed
 

‎solution/0100-0199/0197.Rising Temperature/README.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Weather 表:</code>
6565

6666
### **SQL**
6767

68-
```
68+
```sql
6969
select w1.Id
7070
from
7171
Weather w1,
@@ -74,4 +74,14 @@ where
7474
DATEDIFF(w1.RecordDate, w2.RecordDate) = 1 and w1.Temperature > w2.Temperature
7575
```
7676

77+
```sql
78+
SELECT
79+
w2.id AS Id
80+
FROM
81+
weather AS w1
82+
JOIN weather AS w2 ON DATE_ADD( w1.recordDate, INTERVAL 1 DAY) = w2.recordDate
83+
WHERE
84+
w1.temperature < w2.temperature
85+
```
86+
7787
<!-- tabs:end -->

‎solution/0100-0199/0197.Rising Temperature/README_EN.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ In 2015-01-04, the temperature was higher than the previous day (20 -&gt; 30).
5858

5959
### **SQL**
6060

61-
```
61+
```sql
6262
select w1.Id
6363
from
6464
Weather w1,
@@ -67,4 +67,14 @@ where
6767
DATEDIFF(w1.RecordDate, w2.RecordDate) = 1 and w1.Temperature > w2.Temperature
6868
```
6969

70+
```sql
71+
SELECT
72+
w2.id AS Id
73+
FROM
74+
weather AS w1
75+
JOIN weather AS w2 ON DATE_ADD( w1.recordDate, INTERVAL 1 DAY) = w2.recordDate
76+
WHERE
77+
w1.temperature < w2.temperature
78+
```
79+
7080
<!-- tabs:end -->

0 commit comments

Comments
 (0)