leetcode刷题MySQL题解十九

leetcode刷题MySQL题解十九,第1张

leetcode刷题MySQL题解十九 题目叙述

表: Weather

±--------------±--------+
| Column Name | Type |
±--------------±--------+
| id | int |
| recordDate | date |
| temperature | int |
±--------------±--------+
id 是这个表的主键
该表包含特定日期的温度信息

编写一个 SQL 查询,来查找与之前(昨天的)日期相比温度更高的所有日期的 id 。

返回结果 不要求顺序 。

题目解答
# Write your MySQL query statement below
select b.Id
from Weather as a,Weather as b
where a.Temperature < b.Temperature and DATEDIFF(a.RecordDate,b.RecordDate) = -1;



题目运行

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/905308.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-15
下一篇 2022-05-15

发表评论

登录后才能评论

评论列表(0条)

保存