SQL8 找出所有员工当前薪水salary情况
select salary
from salaries
where to_date='9999-01-01'
group by salary
order by salary desc;
知识点:
使用分组方法对salary进行分组求得,也可以使用distinct去重的方法,但是一般数据较多时使用distinct效率相比group by 要慢,所以从性能角度考虑,应该尽量使用group by
select salary
from salaries
where to_date='9999-01-01'
group by salary
order by salary desc;
知识点:
使用分组方法对salary进行分组求得,也可以使用distinct去重的方法,但是一般数据较多时使用distinct效率相比group by 要慢,所以从性能角度考虑,应该尽量使用group by