|
|
|
Re: to display first 5 highest paid employee [message #41025 is a reply to message #41017] |
Mon, 18 November 2002 21:50 |
Vikas Gupta
Messages: 115 Registered: February 2002
|
Senior Member |
|
|
This is a variation and can give a answer taking into consideration if 2 employees are getting the same salary.
select * from emp a
where 5 >= (select count(*) from emp b where b.sal > a.sal);
Ans:
EMPNO ENAME SAL
--------- ---------- ---------
7566 JONES 2975
7698 BLAKE 2850
7782 CLARK 2450
7788 SCOTT 3000
7839 KING 5000
7902 FORD 3000
|
|
|