文章目录
题目
代码(7.14 首刷看解析)
知识点:datediff(a, b)
返回两个日期的差值。下面采用的是内连接(隐式内连接)
显示内连接是SELECT 字段列表 FROM 表1 [ INNER ] JOIN 表2 ON 连接条件 ...;
显式性能比隐式高
# Write your MySQL query statement below
select b.id from weather a, weather b where DATEDIFF(b.recordDate, a.recordDate) = 1 and b.temperature > a.temperature;
显示内连接
# Write your MySQL query statement below
select b.id from weather a inner join weather b where DATEDIFF(b.recordDate, a.recordDate) = 1 and b.temperature > a.temperature;