Count of element in array

A

Anonymous

Guest
You're looking for GROUP BY. Something like this:

Code:
SELECT first_name, COUNT(first_name) GROUP BY first_name;
 
That's it!
I think there's even the possibility of doing something like:
Code:
mysql > SELECT DISTINCT(first_name), COUNT(first_name) FROM table;
This way you'll get only 1 instance for each name with its respective number (of times repited).
 
Back
Top