網(wǎng)站案例seo網(wǎng)站優(yōu)化價格
題目需求:
計算出比前一天溫度要高的日期。
select a.id
from weather a, weather b
where a.temperature > b.temperature
and datediff(a.recordDate, b.recordDate) = 1;
DATEDIFF(date1, date2)函數(shù)用于計算兩個日期之間的天數(shù)差。函數(shù)返回date1和date2之間的天數(shù)差,正數(shù)表示date1比date2晚,負數(shù)表示date1比date2早。