select count(1) as 户主数量 from ( select op1.wgbm, op1.xm, op1.sfzh, op1.yhzgx, op1.zhbh, concat(op2.ldh,op2.dyh,op2.fh) as fwbh from member_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 ) a where a.wgbm = '${G2}' and a.yhzgx = '户主' |