Subject | Re: Help with query - Invalid expression in the select list |
---|---|
Author | russx2 |
Post date | 2004-09-06T01:05:49Z |
> Just include all of the grouping columns in the column list:Thanks Helen. Simple when you know how, huh? :-) Could you please
> 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, c.name
>
> ./heLen
explain why the extra group-bys are necessary? They seem somewhat
redundant in this example.
I'd assume if I was selecting a further 10 columns, I would also
require the 10 additions to the group-by clause? Not quite sure I
understand this one.
Thanks,
Russ