Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Selects only the first 200 records aftering ordering from a table.
Folks,
Can anyone help me ?
I have a large table, where I only want to select up to a maximum of 500 records.
I can't use ROWNUM because I want to perform an ORDER BY on the table before taking out the first 500 records.
The statement I has was
SELECT A, B, C
FROM table
WHERE Condition
AND rownum < 500
ORDER BY C, B
What this select does is select 500 records, and then orders them.
What I want is to order all records first, and then return the first 500(after ordering).
Anyoue any ideas ?
P.S. I don't want to use PL/SQL and a CURSOR select if possible !.
THANKS Colin Woods. Received on Thu Apr 16 1998 - 07:39:59 CDT
![]() |
![]() |