Friday, February 12, 2010

Programmer - Get mysql result and count specific field

Programmer Question

I have database result like this



ID | NAME     | TYPE
--------------------
1 | baseball | 1
2 | kickball | 1
3 | football | 1
4 | soccer | 2


How do I do a select * so get all results but also get a total count of type = 2 in the results?



Any help appreciated.

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails