![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
文章平均质量分 51
木子_yang
frighting
展开
-
查询薪水第二多的员工薪水
查找当前薪水(to_date=‘9999-01-01’)排名第二多的员工编号emp_no、薪水salary、last_name以及first_name,你可以不使用order by完成吗下面是建表的sql:CREATE TABLE `employees` (`emp_no` int(11) NOT NULL,`birth_date` date NOT NULL,`first_name` varchar(14) NOT NULL,`last_name` varchar(16) NOT NULL.原创 2020-06-01 10:45:09 · 299 阅读 · 0 评论 -
sql实现行列互换
给出一个数据表(rainfall)把此表改成以下的格式2.解题思路(1)使标题行变化select id,'3h','6h','9h','12h' from rainfall;(2)使用case替换常量select id,case ctime when '3h' then ccount else 0 end as '3h',case ctime when '6h' then ccount else 0 end as '6h',case ctime when '9h' then c.原创 2020-05-26 15:21:23 · 996 阅读 · 0 评论