Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: query trigger
andrewst wrote in news:2900872.1053435874_at_dbforums.com:
> Forms always lags behind with improvements to SQL. The ability to refer
> to column aliases in the ORDER BY clause is not supported by your
> version of Forms. Do this instead:
>
> SELECT pcnr, sum(number) AS n
> into :testblock.pc, :testblock.number
> FROM orders
> GROUP BY pcnr
> ORDER BY sum(number) desc;
>
> Your next problem will be that you are sure to raise a TOO_MANY_ROWS
> exception, since INTO can only be used for single-row queries, whereas
> the ORDER BY clause suggests you expect to get more than 1 row back!
What query do you suggest to just show the pcnr and number of the most sold pc. I have one pc in the db that is sold 5000 times and another time it is sold 8000 times. Now I like to show in 2 fields. Pc1 sold 13000 times. Thx for the responce. Received on Tue May 20 2003 - 09:07:42 CDT