Subject Re: [firebird-support] Query Help?
Author Ann W. Harrison
At 12:36 PM 10/31/2004, Lee Jenkins wrote:

>I have a table with the following relevant fields:
>
>ItemID // Integer
>ProductDescription // Varchar
>OrderID // Integer

If I understand, the combination ItemID and OrderID is
unique. If so, this statement:

>SELECT
> Count(ITEMS.PRODUCTDESCRIPTION) AS CountItems,
> Sum(ITEMS.ITEMPRICE) AS TotalItems,
> ITEMS.ORDERID, ITEMS.PRODUCTDESCRIPTION,
>FROM ITEMS
>GROUP BY
> ITEMS.ORDERID,
> ITEMS.PRODUCTDESCRIPTION,
> HAVING ITEMS.ORDERID = :OrdID;

makes no sense whatsoever. If you group by a unique key, there is
no difference between sum(price) and price. Could you restate the
problem?

Regards,


Ann