Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: select first x rows from a query

Re: select first x rows from a query

From: Eugenio <eugenio.spadafora_nospam_at_compaq.com>
Date: 2000/06/09
Message-ID: <8hr08a$amf$1@mailint03.im.hou.compaq.com>#1/1

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>...

>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
>>
>
>
>
Received on Fri Jun 09 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US