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

Home -> Community -> Usenet -> c.d.o.misc -> Re: query trigger

Re: query trigger

From: drukqs <invalid.drukqs_at_NOpandoraSPAM.belgie>
Date: Tue, 20 May 2003 14:07:42 GMT
Message-ID: <Xns9381A40F4742Cinvaliddrukqspandora@195.130.132.65>


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

Original text of this message

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