MYSQL - count the same value (occurrences) in table

Count number of occurrences in DB 

for example, you want to get how many of users with the same DOB in your DB
SELECT dob,
COUNT(dob) AS NumOccurrences
FROM users
GROUP BY dob
HAVING ( COUNT(dob) > 0 );

No comments: