select sex,count(sex)as sl from tablename group by sex
如图,我怎样才能设置一个名称呢,如男,女
select (case when sex=1 then '男' else '女' end)sex,count(sex)as sl from tablename group by sex
select case when sex=1 then '男' else '女' end sex,count(sex)as sl from tablename group by sex