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: retrieving only n rows

Re: retrieving only n rows

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Mon, 26 Mar 2001 08:40:39 +0100
Message-ID: <3abef27d$0$12246$ed9e5944@reading.news.pipex.net>

Which 400 are significant? The answer depends on the exact nature of your problem.

If you only want 400 rows from the resultset and you don't care which rows these are then use the rownum construct.

If you want the TOP 400 look for this query on deja or orafaq.com, you should be aware that where rownum < 401 doesn't return the top 400 results from your resultset.

If you want only distinct values consider using the distinct keyword.

Also you should very seriously consider upgrading from 8.04 to either 8.06 or to 8.16/8.17

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"Karol Brejna" <kazelot_at_thenut.eti.pg.gda.pl> wrote in message
news:Pine.LNX.4.33.0103221214090.1931-100000_at_thenut.eti.pg.gda.pl...

> I use Oracle 8.0.4.
>
> I have a select which gives me thousends of rows but
> only 4 houndred of them is significant to me.
>
> How can I tell Oracle to retrieve only 400 rows (and no more)?
>
>
> Thank you,
> Karol Brejna
>
>
Received on Mon Mar 26 2001 - 01:40:39 CST

Original text of this message

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