selectcount(1) as 户主数量from(select op1.wgbm,op1.xm,op1.sfzh,op1.yhzgx,op1.zhbh,concat(op2.ldh,op2.dyh,op2.fh) as fwbhfrommember_info op1 left join house_info op2 on op1.wgbm = op2.wgbm and op1.zhbh = concat(op2.ldh,op2.dyh,op2.fh)where op2.wgbm is not null) awhere a.wgbm = '${G2}' and a.yhzgx = '户主'