用group分组后统计,sql:select 字段名称, count(*) AS 记录数 from A group by 字段名称;
sql语句 : select sum(case 字段名 when 特定值 then 1 else 0 end) from 表名;希望可以帮到你!
select count(*) from 表 where 字段 =?然后在和其它查询结合在一起就行
select 字段名字 from table group by name