Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Topn query doesnt work in PL/SQL

Topn query doesnt work in PL/SQL

From: Rob Edgar <rob_at_dotmedia.net>
Date: Thu, 30 Dec 1999 00:03:39 +0800
Message-ID: <84dbbo$l0c10@imsp212.netvigator.com>


The query below will execute in SQL Plus but in a PL/SL procedure it wont compile giving an error on the order by clause.

select ROWNUM AS Rank, Name, Region, Sales from   (select Name, Region, sum(Sales) AS Sales

      from Sales GROUP BY Name, Region
      order by sum(Sales) DESC)

WHERE ROWNUM <= 10

Have I done something wrong or is this a bug, if so is there a workaround.

Rob Received on Wed Dec 29 1999 - 10:03:39 CST

Original text of this message

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