SQL_202

找出所有员工当前薪水salary情况

https://www.nowcoder.com/practice/ae51e6d057c94f6d891735a48d1c2397

方法一:

思路:对工资去重,降序

代码:

select distinct salary from salaries where to_date='9999-01-01' order by salary desc

方法二:

思路:用 group By 去重对工资去重,再降序。 group by 去重的性能高于 distinct

代码:

select salary from salaries where to_date='9999-01-01' group by salary order by salary desc;

全部评论

相关推荐

代码飞升:别用口语,后端就写后端,前端就写前端,最后别光后悔
点赞 评论 收藏
分享
评论
5
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务