Subject | Re: [firebird-support] multiple group by |
---|---|
Author | Daniel Rail |
Post date | 2004-11-23T12:24:56Z |
Hi,
At November 22, 2004, 12:53, Michal eravík wrote:
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At November 22, 2004, 12:53, Michal eravík wrote:
> I had similar problem as I found in forum:Yes that is correct. And, this is part of the SQL standard.
> SELECT
> c.categoryid,
> c.name,
> COUNT(x.categoryid)
> FROM
> categories c
> LEFT JOIN
> books_to_categories x
> ON c.categoryid = x.categoryid
> GROUP BY c.categoryid
> Try the group by clause:
> GROUP BY c.categoryid, c.name
> If you combine in the select an aggregate function (count, sum, max)
> together with 'normal' colums (id, name, etc.), all the normal columns
> have to be in the group by clause.
> Is it right? I really need all columns I want to list put to Group By
> clause?
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)