当前位置:网站首页>LeetCode - Easy - 197

LeetCode - Easy - 197

2022-06-28 02:31:00 Minsk open source

| recordDate | date |

| temperature | int |

±--------------±--------+

id is the primary key for this table.

This table contains information about the temperature in a certain day.

Write an SQL query to find all dates’ id with higher temperature compared to its previous dates (yesterday).

Return the result table in any order.

The query result format is in the following example:

Weather

±—±-----------±------------+

| id | recordDate | Temperature |

±—±-----------±------------+

| 1 | 2015-01-01 | 10 |

| 2 | 2015-01-02 | 《 A big factory Java Analysis of interview questions + Back end development learning notes + The latest architecture explanation video + Practical project source code handout 》 Free open source Prestige search official account 【 Advanced programming 】 25 |

| 3 | 2015-01-03 | 20 |

| 4 | 2015-01-04 | 30 |

±—±-----------±------------+

Result table:

±—+

| id |

±—+

| 2 |

| 4 |

±—+

In 2015-01-02, temperature was higher than the previous day (10 -> 25).

In 2015-01-04, temperature was higher than the previous day (30 -> 20).

原网站

版权声明
本文为[Minsk open source]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/179/202206280027225267.html