Subject Group By in For Select
Author Muthu Annamalai
I have this following Stored Procedure and I need to group by a
column but I am getting Invalid expression in Select List error

FOR SELECT RECEIPTDATE, RECEIPTDETAILS.ID, ITEMSTYLEID,
SUM(RECEIPTDETAILS.QUANTITY * RECEIPTDETAILS.PRICE)
FROM RECEIPT, RECEIPTDETAILS
WHERE RECEIPT.ID = RECEIPTDETAILS.RECEIPTID AND
RECEIPT.RECEIPTDATE BETWEEN :FROMDATE AND :TODATE
GROUP BY 3
INTO SALESDATE, RECEIPTDETAILSID, ITEMSTYLEID, SALES
DO
BEGIN
/* Code removed for simplicity */
SUSPEND;
END

Any help is highly appreciated

Thanks

Muthu Annamalai