------解决方案-------------------- select sum(d),sum(c),
sum(decode(b,'住宅',d,0)),
sum(decode(b,'住宅',c,0)),
sum(decode(b,'非住宅',d,0)),
sum(decode(b,'非住宅',c,0)) from table where a=4027 group by a ------解决方案--------------------
SELECT SUM(D),
SUM(C),
SUM(DECODE(B, '住宅', D, 0)),
SUM(DECODE(B, '住宅', C, 0)),
SUM(DECODE(B, '非住宅', D, 0)),
SUM(DECODE(B, '非住宅', D, 0))
FROM TABLE
WHERE A = 4027