上升的温度-leetcode

上升的温度


这是一道使用 sql 语句编程的题目

1. 地址

https://leetcode-cn.com/problems/rising-temperature/

2. 解法

联表查询
注意联表的条件和取值

# Write your MySQL query statement below
select w1.Id
from Weather as w1, Weather as w2
where from_unixtime(unix_timestamp(w1.RecordDate) - 86400, '%Y-%m-%d') = w2.RecordDate 
and w1.Temperature > w2.Temperature
posted @ 2020-06-21 21:14  吴丹阳-V  阅读(132)  评论(0编辑  收藏  举报