Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: select first x rows from a query
Wow, I've never used ORDER BY in subqueries. I'll try it asap. Thanks for the info.
For releases < 8i, the query
select *
from ( select * from t1, t2, t3 where ..... group by ... having ... )
where rownum < N
should work only if your ORDER BY is ASC because it uses the implicit ASC ORDER of GROUP BY.
Thanks again for 8i info (I have 8.0.5 on NT now)
-- be happy ... Eugenio remove _nospam from reply address Opinions are mine and do not necessarily reflect those of my company ======================================================= Peter Dickmann wrote in message <3940fc5e_at_news.lhsgroup.com>...Received on Fri Jun 09 2000 - 00:00:00 CDT
>See attached posting from T.Kyte.
>Peter
>
>
>Tom <schelhor_at_fh-coburg.de> wrote in message
>news:3940E4F8.E71B965_at_fh-coburg.de...
>> Hi everybody!
>>
>> I've a table with several rows. Then I've to run a query like:
>>
>> SELECT col1 FROM mytable ORDER BY col3 DESC;
>>
>> But now I need only the first 3 rows of that resultset. Is there a way
>> to do this in
>> a SQL-Statement (I know: I could do that using a FOR-loop in a
>> procedure, but
>> this will cause some other problems ...)
>>
>> thanx in advance
>> Tom
>>
>
>
>
![]() |
![]() |