select nv=(select count(*) from table where sex='女'),nan=(select count(*) from table where sex='男')from table这样就可以分别统计男和女的数量了.
select sex , count(*) 人数 from table group by sex