[UPHPU] MySQL query to get totals
Brandon Stout
bms at mscis.org
Sun Sep 28 20:12:38 MDT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Wade Preston Shearer wrote:
> On 28 Sep 2008, at 10:11, Morgan Terry wrote:
>
>> It sure is. Something like this should work:
>> SELECT primary_key, sum(id)
>> FROM table_name
>> GROUP BY primary_key
>
> That didn't work for me, but you got me going in the wright direction.
> This worked:
>
> SELECT ID, count(ID) as count
> FROM table_name
> GROUP BY ID
> ORDER BY ID
>
>
> Thanks.
I, for one, am glad Wade 'wrote' it the 'wright' way.
Brandon Stout
Stout Hosting LLC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iEYEARECAAYFAkjgOZYACgkQx0pgn74qrcLMqgCgko1cAiMdXVim7w45YYN0z1va
VcwAn0OLDO/s/p3FtWoYU3JXBB30cjg8
=Drc8
-----END PGP SIGNATURE-----
More information about the UPHPU
mailing list