Subject | Re: [firebird-support] Group By in For Select |
---|---|
Author | Ann W. Harrison |
Post date | 2006-07-13T17:01:01Z |
Muthu Annamalai wrote:
in the select list without aggregating it.
Try either GROUP BY 1, 3 or SELECT MAX(ReceiptDate) ...
Regards,
Ann
> I have this following Stored Procedure and I need to group by aYou're grouping by ItemStyleID, but reference ReceiptDate
> 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
>
in the select list without aggregating it.
Try either GROUP BY 1, 3 or SELECT MAX(ReceiptDate) ...
Regards,
Ann