Puiu Posted June 4, 2005 Posted June 4, 2005 I have a table Users with the fields : username varchar(50), Birthdate Datetime I want to select the month in which most users are born Quote
HJB417 Posted June 4, 2005 Posted June 4, 2005 I'd think you'd want something like SELECT COUNT(username) AS num_of_users, MONTH(Birthdate) GROUP BY MONTH(Birthdate) ORDER BY num_of_users Quote
PROKA Posted June 4, 2005 Posted June 4, 2005 more like SELECT TOP 1 MONTH(Birthdate) FROM Users GROUP BY MONTH(Birthdate) ORDER BY COUNT(username) DESC Quote Development & Research Department @ Elven Soft
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.