Loading

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

https://www.nowcoder.com/practice/ae51e6d057c94f6d891735a48d1c2397?tpId=82&tags=&title=&difficulty=0&judgeStatus=0&rp=1

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

知识点:
使用分组方法对salary进行分组求得,也可以使用distinct去重的方法,但是一般数据较多时使用distinct效率相比group by 要慢,所以从性能角度考虑,应该尽量使用group by

posted @ 2022-01-08 20:41  Zhbeii  阅读(55)  评论(0编辑  收藏  举报