select (select count(*) from rl_ry as b where b.bn=a.bn and b.zzsx='1' and b.xb='1') as '在职职工男',
(select count(*) from rl_ry as b where b.bn=a.bn and b.zzsx='1' and b.xb='2') as '在职职工女',
(select count(*) from rl_ry as b where b.bn=a.bn and b.zzsx='1' and b.xb='1') as '离休职工男',
(select count(*) from rl_ry as b where b.bn=a.bn and b.zzsx='3' and b.xb='2') as '离休职工女',
(select count(*) from rl_ry as b where b.bn=a.bn and b.zzsx='3' and b.xb='1') as '退休职工男',
(select count(*) from rl_ry as b where b.bn=a.bn and b.zzsx='1' and b.xb='2') as '退休职工女',
(select count(*) from rl_ry as b where b.bn=a.bn) as '人数'
from rl_ry as a
group by bn