select colnum, sum(decode(rnum,1, decode(c.iszy, '1', 1, 0),0)) rnum1,
sum(decode(rnum,2, decode(c.iszy, '1', 1, 0),0)) rnum2,
sum(decode(rnum,3, decode(c.iszy, '1', 1, 0),0)) rnum3,
sum(decode(rnum,4, decode(c.iszy, '1', 1, 0),0)) rnum4,
sum(decode(rnum,5, decode(c.iszy, '1', 1, 0),0)) rnum5,
sum(decode(rnum,6, decode(c.iszy, '1', 1, 0),0)) rnum6
from ldry_gj_fxsz a, ldry_gj b, ldry_gj_record c
where a.id = b.fxid(+)
and b.id = c.gjid(+)
and dqbh = '330201'
and mxbh = '1'
group by colnum
order by colnum;
sum(decode(rnum,2, decode(c.iszy, '1', 1, 0),0)) rnum2,
sum(decode(rnum,3, decode(c.iszy, '1', 1, 0),0)) rnum3,
sum(decode(rnum,4, decode(c.iszy, '1', 1, 0),0)) rnum4,
sum(decode(rnum,5, decode(c.iszy, '1', 1, 0),0)) rnum5,
sum(decode(rnum,6, decode(c.iszy, '1', 1, 0),0)) rnum6
from ldry_gj_fxsz a, ldry_gj b, ldry_gj_record c
where a.id = b.fxid(+)
and b.id = c.gjid(+)
and dqbh = '330201'
and mxbh = '1'
group by colnum
order by colnum;