Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Topn query doesnt work in PL/SQL
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)
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
![]() |
![]() |