| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Best method to SELECT TOP n TO m of a table
Hi there,
I was wondering if there was a better way to do a SELECT where it returns not the TOP 5 (or whatever) but, say, the TOP 6 to 8?
What I've currently got is...
SELECT TOP 3 * FROM table WHERE
id NOT IN (SELECT TOP 5 id FROM table ORDER BY id) ORDER BY id
While this is ok for this (simple) query, it can get quite messy if the query is more complex. There must be a better way of doing it, mustn't there?
Thanks for any help :o)
Will Received on Tue Nov 04 2003 - 08:15:04 CST
![]() |
![]() |