--创建去重后的工资排序
create or replace view e2
as
select distinct sal from emp order by sal desc
--查询工资前三
--select sal from e2 where rownum < =3
--方法一:使用in和rownum
select * from emp
where sal in (select sal from e2 where rownum < =3) order by sal desc
--方法一:使用any和rownum
select * from emp
where sal >= any(select sal from e2 where rownum <= 3) order by sal desc
Oracle查询工资前三的员工信息
最新推荐文章于 2022-08-30 09:03:34 发布