SELECT DATEDIFF('2017-11-30', '2017-11-29') AS COL1, -- 1DATEDIFF('2017-11-30', '2017-12-15') AS col2; -- -15
https://leetcode-cn.com/problems/rising-temperature/
-- DATEDIFF(a.RecordDate, b.RecordDate)=1,表示a是今天b是昨天
SELECTa.id AS 'Id'
FROMWeather a JOIN Weather b ON DATEDIFF(a.RecordDate, b.RecordDate) = 1 AND a.Temperature > b.Temperature;
http://c.biancheng.net/mysql/datediff.html