根据a.jw分组,分组后根据distinct 去重身份证号字段统计
select a.jw 居委,count(distinct a.sfzh) 人数
from kjzl_oldperson_base a where a.jd = '310115136' and a.sfyxztid = '1' and a.lrdazt = '2' group by a.jw;根据a.jw分组,分组后根据distinct 去重身份证号字段统计
select a.jw 居委,count(distinct a.sfzh) 人数
from kjzl_oldperson_base a where a.jd = '310115136' and a.sfyxztid = '1' and a.lrdazt = '2' group by a.jw;