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: TOP-N query

Re: TOP-N query

From: Rich Mycroft <rich.mycroft_at_synchrologic.com>
Date: 2000/07/20
Message-ID: <J7Id5.629$QG2.3169@newsfeed.slurp.net>#1/1

Try:

SELECT fid
 FROM

     (SELECT fid
     FROM contact
     ORDER BY fid DESC)

 WHERE rownum<20

Rich Mycroft

"Brad huskins" <bhuskins_at_christian-horizons.org> wrote in message news:3979CBE4.1942A60B_at_christian-horizons.org...
> When I try to execute a TOP-N query (containing a subquery with a ORDER
> BY
> statement) to retrieve the first 20 records of a query
> (e.g. SELECT fid
> FROM
> (SELECT fid
> FROM contact
> ORDER BY fid DESC)
> WHERE rownum<20)
>
> I get a 'missing right parenthesis' error. The documentation for the 8
> Client says this should work. We're running Oracle Server version
> 7.3.4.0.1.
>
> Can someone tell me what is wrong and if there's a way around the
> problem?
> Thanks in advance.
>
Received on Thu Jul 20 2000 - 00:00:00 CDT

Original text of this message

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