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

#请你找出所有员工具体的薪水salary情况,对于相同的薪水只显示一次,并按照逆序显示

#方法一:使用distinct去重(一般用于数据量相对较少)
/*
select distinct salary
from salaries
where to_date = '9999-01-01'
order by salary desc
*/

#方法二:使用group by 去重分组(一般用于数据量相对较少)
select salary
from salaries
where to_date = '9999-01-01'
group by salary
order by salary desc

全部评论

相关推荐

点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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