[thelist] [mysql] count query
rudy
rudy937 at rogers.com
Thu Sep 11 10:12:05 CDT 2003
some sql guy called rudy pontificated:
>> You *must* group by any columns that are not
>> aggregated in the select clause when you have
>> at least one that is aggregated.
>
> that's usually true, except that the GROUP BY clause
> is optional
>
> if it's missing, the entire record set is considered
> a group, and the result is one row
i am an idiot © ™ ®
if the GROUP BY is missing, there cannot be any
non-aggregate columns in the SELECT
joshua was right, you *must* group by all non-aggregates
well, except if it's mysql, where you can group
by only the unique ones
rudy
More information about the thelist
mailing list