Leetcode SQL 50 -- 197. Rising Temperature
Question
Table name: Weather
| Column Name | Type |
|---|---|
| id | int |
| recordDate | date |
| temperature | int |
There are no different rows with the same recordDate.
This table contains information about the temperature on a certain day.
Write a solution to find all
dates' idwith higher temperatures compared to its previous dates (yesterday).
Return the result table in any order.
Explaination
Here, we need to learn how to handle the datatype date.
To modify the date, we can use INTERVAL keyword, or DATEADD() function.
INTERVAL <value> <unit>
Interval is a special datatype, that can interact with time and date.
Interval unit includes
microsecond, millisecond, second, minute, hour, day, week, month, year, decade, century, millennium