Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: A sample question
>Suppose I have a table contains 10000 employee's names and their salaries.
>Who can come out a query can get the 1000 highest salary employees?
Dong
You can also use the following statement::
SELECT Sal FROM
(
SELECT -Sal, Sal FROM Employees
GROUP BY -Sal, Sal
)
WHERE rownum < 1000
Regards
Fernando Carvalho Received on Wed Sep 23 1998 - 09:57:15 CDT