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 -> Error at Group By clause

Error at Group By clause

From: TR <tristan_robinson_at_cooltoad.com>
Date: 20 Mar 2006 07:55:20 -0800
Message-ID: <1142870118.800269.223650@t31g2000cwb.googlegroups.com>


Hi,
I have the following sql query.

SELECT
A.PROD_NUM, B.ITEM_LEVEL, B.PURCHS_DATE, SUM(DECODE(C.ITEM,'H',1,0))HOT,
SUM(DECODE(C.ITEM,'C',1,0))COLD,
COUNT(*)TOTAL_ITEMS
FROM PROD_DETAIL A, ITEM_DETAIL B, PURCHASE_DETAIL C WHERE
A.PROD_ID = B.PROD_ID AND
B.ITEM_ID = C.ITEM_ID
GROUP BY
A.PROD_NUM, B.ITEM_LEVEL, B.PURCHS_DATE, SUM(DECODE(C.ITEM,'H',1,0))HOT,
SUM(DECODE(C.ITEM,'C',1,0))COLD,
COUNT(*)TOTAL_ITEMS; I want the output as follows in 6 different columns: Prod_Num Item Level Purchase_Date Hot Cold Total_Items

When I am executing the query I am getting the following error: GROUP_BY
*
ERROR at line 10:
ORA-00933: SQL command not properly ended

Its pointing the error at GROUP BY. Can any one of you plz explain me where I am going wrong and how to execute the command correctly?

Thank you.

TR. Received on Mon Mar 20 2006 - 09:55:20 CST

Original text of this message

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