SQL: Rising Temperature
Medium
SQL — Self Join
SQL
Self Join
DATE
Find dates where temperature was higher than the day before.
Constraints
Write standard SQL (MySQL 8.0 compatible).
Examples
Example 1:
Input: date temp
2024-01-01 10
2024-01-02 15
2024-01-03 12
Output:
Example 2:
Input: date temp
2024-01-01 10
2024-01-02 15
2024-01-03 12
Output:
Hints
Self-join on consecutive dates.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console