Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Select Unique and Common rows from two tables

Re: Select Unique and Common rows from two tables

From: 8trium <not_available>
Date: Fri, 18 Sep 1998 15:34:05 -0700
Message-ID: <6tumls$htu@romeo.logica.co.uk>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US