Click to See Complete Forum and Search --> : Is there a MySql fuction to do this?


gogelpot
09-27-2006, 12:43 AM
Hi

I would like to know if there is a MySql function that can tel me how many diff. data elements there are in a table colom.

I have a DB with a colom named: Pool
There may be 1 to 4 pools in that league named: A1P1 - A1P4

I need to know if there is more then just A1P1 and how many.
eg: A1P1, A1P2. or A1P1, A1P2, A1P3 ect.

Could somebody please help me?

PS There may be more then one A1P1, but that needs to only count as one.

chazzy
09-27-2006, 07:01 AM
you can do a distinct select, and then a count off of that..so maybe something like

SELECT COUNT(*) FROM
(SELECT DISTINCT `column` FROM `table`)