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;

全部评论

相关推荐

4 收藏 评论
分享
牛客网
牛客企业服务