MySQL doesn't seem to like it when you use MAX(COUNT(column_name)) ... What I would normally do is, if I have a query like:
Code:
SELECT DISTINCT field_1, count(field_2) as f2_count FROM the_table
which returns ALL of the field_1 values with counts of field_2, then I would use:
Code:
SELECT DISTINCT field_1, count(field_2) as f2_count FROM the_table ORDER BY f2_count DESC LIMIT 1
to return only the highest. Hope that helps. Note that this should be the same thing:
Code:
SELECT field_1, count(field_2) as f2_count FROM the_table GROUP BY field_1 ORDER BY f2_count DESC LIMIT 1