select
cc,
SUM( case when d_date ='20220427' THEN qty ELSE qty END) qq,
SUM( case when d_date ='20220426' THEN qty ELSE qty END) ww
from
(
select '20220427' d_date, 'A' CC , 100 qty from dual union
select '20220427' d_date, 'A' CC , 200 qty from dual union
select '20220427' d_date, 'A' CC , 200 qty from dual union
select '20220426' d_date, 'A' CC , 900 qty from dual union
select '20220426' d_date, 'A' CC , 200 qty from dual union
select '20220426' d_date, 'A' CC , 200 qty from dual
)
where d_date in('20220427','20220426')
group by cc
이렇게하면
QQ는 500 WW의 컬럼은 1400이 나와야하는것아닌가요 ???