Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Oracle and Top
"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 Thu Nov 23 2000 - 02:15:54 CST
![]() |
![]() |