Fetching algorithms...
Fetching algorithms...
| 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 |
| 4 |
Let's walk through the example:
id=1 (2015-01-01, 10), there is no previous day to compare, so it's excluded.id=2 (2015-01-02, 25), the previous day was 2015-01-01 with a temperature of 10. Since 25 > 10, id=2 is included in the result.id=3 (2015-01-03, 20), the previous day was 2015-01-02 with a temperature of 25. Since 20 is not greater than 25, id=3 is excluded.id=4 (2015-01-04, 30), the previous day was 2015-01-03 with a temperature of 20. Since 30 > 20, id=4 is included in the result.Therefore, the final output contains ids 2 and 4.