Thursday, June 16, 2011

SQL count the same value in selected field

Count number of user with same DOB in DB 
SELECT dob,
COUNT(dob) AS NumOccurrences
FROM members
GROUP BY dob
HAVING ( COUNT(dob) > 0 )

No comments:

Post a Comment