[UPHPU] MySQL query to get totals

Wade Preston Shearer lists at wadeshearer.com
Sun Sep 28 10:34:29 MDT 2008


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20080928/0a6ff97a/smime.bin


More information about the UPHPU mailing list