
Problem
Given a Weather table, write a SQL query to find all dates’ Ids with higher temperature compared to its previous (yesterday’s) dates.
|
|
For example, return the following Ids for the above Weather table:
|
|
Analysis
Join two Weather tables to iterate all possible (today, yesterday) and filter with
today.Temperature > yesterday.Temperature.
Solution
|
|
Link
197. Rising Temperature
(中文版) SQL 笔记: Leetcode#197 Rising Temperature




近期评论