数据库SQL实践8:找出所有员工当前薪水salary情况

思想:

题目要求找出所有员工当前薪水salary情况,对于相同的薪水只显示一次,并按照逆序显示。首先根据当前薪水的要求通过条件to_date = '9999-01-01'来达到目的,然后根据相同的薪水只显示一次的要求通过条件distinct salary来达到目的,最后通过order by salary desc来实现逆序。

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

猜你喜欢

转载自blog.csdn.net/weixin_43160613/article/details/83473911