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: Oracle and Top

Re: Oracle and Top

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Wed, 22 Nov 2000 16:35:35 -0000
Message-ID: <8vgsku$1vc$1@soap.pipex.net>

Hi

the pseudo column rownum allows you to limit rows returned to the first x

eg select * from tab where rownum < 11 gives the first 10 rows.

However you will need (8i only) to do an order by in an inline query to get the equivalent functionality to TOP in SQL server/Access.

eg

select * from
(select * from tab order by 1 desc)
where rownum < 11;

regards

--
Niall Litchfield
Oracle DBA
Audit Commission UK
"Ulrich Haucke" <uhaucke_at_netscape.net> wrote in message
news:8vgq3m$4at8o$1_at_ID-58000.news.dfncis.de...

> Hi everyone,
>
> I have a SQL-Statement that gives me back a very big result.
> So I like to show only the top 10 or so.
>
> How can I do this?
>
>
>
>
Received on Wed Nov 22 2000 - 10:35:35 CST

Original text of this message

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