Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: TOP-N query
Try:
SELECT fid
FROM
(SELECT fid FROM contact ORDER BY fid DESC)
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