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: Ulrich Haucke <uhaucke_at_netscape.net>
Date: Fri, 24 Nov 2000 08:59:25 +0100
Message-ID: <8vl750$4t4pa$1@ID-58000.news.dfncis.de>

Sorry, but now I know why it doesen't work: I've got Oracle 8 and the target system is Oracle 7...

"Ulrich Haucke" <uhaucke_at_netscape.net> schrieb im Newsbeitrag news:8vijns$4gvcv$1_at_ID-58000.news.dfncis.de...
>
> "Niall Litchfield" <n-litchfield_at_audit-commission.gov.uk> schrieb im
> Newsbeitrag news:8vgsku$1vc$1_at_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;
> I've tryed this, but it doesend work. I think this is because I'm using a
> group by-statement. Is this right?
>
> Here is the original statement:
> select kdnr, count(kdnr) as hits from stat_data where sid='5' group by
 kdnr
> order by hits desc
> >
> > 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 Fri Nov 24 2000 - 01:59:25 CST

Original text of this message

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