希望您满意。select * from (select a.item_id ,a.A_qty,b.B_qty from a left outer join b
on a.item_id=b.item_id)
union
select * from (select b.item_id ,a.A_qty,b.B_qty from a right outer join b
on a.item_id=b.item_id)
on a.item_id=b.item_id)
union
select * from (select b.item_id ,a.A_qty,b.B_qty from a right outer join b
on a.item_id=b.item_id)
a.a_qty,
b.b_qty
from a
full outer join b on
a.item_id = b.item_id
/
select a.*, b.b_qty from a, b
where +a.item_id=+b.item_id
(select item_id,A_qty,0 B_qty from a
union all
select item_id,0 A_qty,B_qty from b)
group by item_id
FROM A,B
WHERE A.ITEM_ID=B.ITEM_ID(+)
UNION
SELECT B.ITEM_ID ITEM_ID ,NVL(A.A_QTY,0) A_QTY,NVL(B.B_QTY,0) B_QTY
FROM A,B
WHERE B.ITEM_ID=A.ITEM_ID(+)
from(
select item_id,a_qty qty_A ,0 qty_B from a
union
select item_id,0 qty_A ,b_qty qty_B from b
)
groub by item_id