Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Limit a result list
I have the following problem:
How can I get the results (for example 30 - 39) from a select statement? The result list should by ordered by a date.
With MySQL I did it like :
SELECT * FROM tablename WHERE something ORDER BY entrydate LIMIT 30, 10
With Oracle I did it like :
SELECT *
FROM (
SELECT *
FROM tablename
WHERE something
ORDER BY entrydate
)
WHERE NUMROWS < 40
MINUS
SELECT *
FROM (
SELECT *
FROM tablename
WHERE something
ORDER BY entrydate
)
WHERE NUMROWS < 30
This query is not very efficient. Is there no better way to do that?
thanks.
-- Posted via Mailgate.ORG Server - http://www.Mailgate.ORGReceived on Tue Dec 03 2002 - 08:31:49 CST
![]() |
![]() |