Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Select Unique and Common rows from two tables
Considering a table (A) 'po_lines_ordered' with columns 'ponum','polinenum'
and 'poqty', and a table (B) 'po_lines_shipped' with the same columns, I am
assuming in this case you would be trying to substract the shipped quantity
(where some have been shipped) from the ordered quantity to find out how
many outstanding orders have yet to be fulfilled:
SELECT a.ponum, a.polinenum, a.poqty - NVL(b.poqty,0)
FROM po_lines_ordered a, po_lines_shipped b
WHERE a.ponum = b.ponum (+)
AND a.polinenum = b.polinenum (+)
This seems to do what you want, although I may have missed what you mean.
Matt Received on Fri Sep 18 1998 - 17:34:05 CDT
![]() |
![]() |