|
-
Hi
1 select empno,sal
2 from emp e
3 where 5>(select count(*) from emp
4 where sal>e.sal)
5* order by sal desc
SQL> /
EMPNO SAL
---------- ----------
7839 5000
7788 3000
7902 3000
7566 2975
7698 2850
SQL> set pagesize 100
SQL> select empno,sal from emp
2 order by sal desc
3
SQL> /
EMPNO SAL
---------- ----------
7839 5000
7788 3000
7902 3000
7566 2975
7698 2850
7782 2450
7499 1600
7844 1500
7934 1300
7521 1250
7654 1250
7876 1100
7900 950
7369 800
14 rows selected.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|