Subject | Re: Group By in For Select |
---|---|
Author | Adam |
Post date | 2006-07-13T23:30:25Z |
--- In firebird-support@yahoogroups.com, "Muthu Annamalai"
<pearlamerica@...> wrote:
INTO :SALESDATE, :RECEIPTDETAILSID, :ITEMSTYLEID, :SALES
Adam
<pearlamerica@...> wrote:
>You must include ALL non aggregate fields in your group by.
> 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 3The following line should have colons before your variable/parameter
> INTO SALESDATE, RECEIPTDETAILSID, ITEMSTYLEID, SALESIn other words.
INTO :SALESDATE, :RECEIPTDETAILSID, :ITEMSTYLEID, :SALES
Adam