SQL8 找出所有员工当前薪水salary情况
作者:互联网
描述
有一个薪水表,salaries简况如下:
请你找出所有员工具体的薪水salary情况,对于相同的薪水只显示一次,并按照逆序显示,以上例子输出如下:
找出所有员工当前(to_date=‘9999-01-01’)具体的薪水salary情况,对于相同的薪水只显示一次,并按照逆序显示
方法1:
distinct+order by select distinct salary from salaries where to_date='9999-01-01' order by salary desc
方法2:
select salary from salaries where to_date='9999-01-01' group by salary order by salary desc
标签:SQL8,salary,01,薪水,salaries,9999,date 来源: https://www.cnblogs.com/dtx123/p/15359292.html