101
0/304
Loading content...
You are given a table named Weather with daily measurements:
Return the ids of all days where temperature is strictly higher than the temperature on the previous calendar day.
Important rule:
Output requirements:
This problem should be solvable in both:
Weather:
| id | recordDate | temperature |
|----|------------|-------------|
| 1 | 2015-01-01 | 10 |
| 2 | 2015-01-02 | 25 |
| 3 | 2015-01-03 | 20 |
| 4 | 2015-01-04 | 30 |[
{"id": 2},
{"id": 4}
]Day 2 is warmer than day 1 (25 > 10), and day 4 is warmer than day 3 (30 > 20). Day 3 is not included because it is cooler than day 2.
Weather:
| id | recordDate | temperature |
|----|------------|-------------|
| 10 | 2024-05-01 | 12 |
| 11 | 2024-05-03 | 18 |
| 12 | 2024-05-04 | 19 |[
{"id": 12}
]Id 11 is not compared to id 10 because 2024-05-02 is missing. Id 12 is compared to id 11 and qualifies since 19 > 18.
Weather:
| id | recordDate | temperature |
|----|------------|-------------|
| 21 | 2023-12-31 | -2 |
| 22 | 2024-01-01 | -2 |
| 23 | 2024-01-02 | 1 |[
{"id": 23}
]Equal temperatures do not count as an increase. Only id 23 is strictly warmer than the previous day.
Constraints