题目:编写一个 SQL 查询,来查找与之前(昨天的)日期相比温度更高的所有日期的 id 。
刚开始学,不明白这样写为什么不行,请教
# Write your MySQL query statement below
select W2.id from Weather as w1, Weather as W2 where W2.temperature>W1.temperature and W2.recordDate=W1.recordDate+1;
只通过了13个测试用例,报错的这个测试用例太长了,一时间看不出来是哪里有问题
有看到题解,日期比较是有专门的函数DATEDIFF()
但还是想知道这个为什么不行~