with t as
(select 'A' cxfl, 1001 dwbm, 10 counter
from dual
union all
select 'B' cxfl, 1001 dwbm, 5 counter
from dual
union all
select 'B' cxfl, 1002 dwbm, 3 counter
from dual
union all
select 'C' cxfl, 1003 dwbm, 2 counter
from dual)
SELECT DISTINCT t1.CXFL,
t2.dwbm,
nvl((select counter
from t t3
where t3.cxfl = t1.cxfl
and t2.dwbm = t3.dwbm),
0)
FROM T t1, t t2
order by dwbm,cxfl;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货