MySQL Forums
Forum List  »  Newbie

Re: have a query problem
Posted by: Umesh Shastry
Date: June 11, 2005 07:28AM

Hi Vishal!!

Try this..

SELECT country, count( country ) , sum(
IF (
sex = 'M', 1, 0
) ) AS male, SUM(
IF (
sex = 'F', 1, 0
) ) AS female
FROM userinfo
GROUP BY country
LIMIT 0 , 30


Hope This Helps!

Regards,
Umesh Shastry
http://www.blogger.com/profile/02551756983528645221

Options: ReplyQuote


Subject
Written By
Posted
June 11, 2005 03:00AM
Re: have a query problem
June 11, 2005 07:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.