Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Selects only the first 200 records aftering ordering from a table.
Sorry, I had a good idea, but...
Below right way
First way:
SELECT A, B, C
FROM table
WHERE rowid in (select rowid
from table
where Condition
AND rownum < 500)
ORDER BY C, B;
Second way:
Step 1:
CREATE VIEW q_table
AS
SELECT *
FROM table
WHERE Condition
AND rownum < 500 ;
Step 2.
select A,B,C
from q_table
order by C,B;
Second way is faster than first, but "Condition" must be CONST. Received on Fri Apr 17 1998 - 02:11:23 CDT
![]() |
![]() |