MySQL-Rising Temperature
来源:互联网 发布:北京软件行业协会 编辑:程序博客网 时间:2024/05/17 21:44
Given a Weather
table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates.
+---------+------------+------------------+| Id(INT) | Date(DATE) | Temperature(INT) |+---------+------------+------------------+| 1 | 2015-01-01 | 10 || 2 | 2015-01-02 | 25 || 3 | 2015-01-03 | 20 || 4 | 2015-01-04 | 30 |+---------+------------+------------------+For example, return the following Ids for the above Weather table:
+----+| Id |+----+| 2 || 4 |+----+
Subscribe to see which companies asked this question.
题目大意:
给定Weather表,编写SQL查询找出所有温度较前一天高的记录Id。
select w1.Id from Weather w1 inner join Weather w2 on TO_DAYS(w1.Date) =TO_DAYS(w2.Date) + 1 where w1.Temperature>w2.Temperature order by Id;
0 0
- MySQL-Rising Temperature
- 题目10:MySQL---------Rising Temperature
- Rising Temperature
- Rising Temperature
- Rising Temperature
- Rising Temperature
- Rising Temperature
- Rising Temperature
- 【MySQL】【leetcode】 Rising Temperature解题报告
- [LeetCode][Database]Rising Temperature
- LeetCode Rising Temperature
- Leetcode: Rising Temperature
- 【LeetCode】Rising Temperature
- 【leetcode】 database Rising Temperature
- Rising Temperature Inner Join
- Rising Temperature--easy
- Leetcode:Rising Temperature database
- leetcode197-Rising Temperature
- 安装spring IDE插件 版本号一定要对上
- 表达式计算(C++实现)
- BaseActivity
- 年青人,渴望力量吗?
- 111
- MySQL-Rising Temperature
- 【活动时间调整】博客搬家,有礼相送
- 製作影像檔(VideoWriter)
- JavaScript---函数
- Linux连接SqlServer的图形化工具SQuirrel
- UIButton将title和image放置在任意位置上
- hive从hdfs文件系统里面读取数据
- 在eclipse安装SVN & TestNg
- soap error 错误对照表