I want to select distinct values, and the count of the distinct values.
An example table would be:
I want my query to return:Code:field +-------+ | A | | A | | B | +-------+
I've tried permutations of count(distinct(field), field etc etc but I just end up with one row- when from looking at SELECT *, I can clearly see the query I'm wanting returned should have at least 100 rows.Code:| field | count(field) | +-------+--------------+ | A | 2 | | B | 1 | +-------+--------------+
Edit: I know I can do this with php or two queries/stage table, but this really should be a 1 query thing.


Reply With Quote
Bookmarks