Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: 2nd try
Patrice Béliveau wrote:
> Hi,
>
> I have two table, one is containing a dated list of delivery to do and
> the second contain a list of delivery done.
>
> ex: Table 1 --> Order No,
> Delivery date requested,
> Quantity requested
>
> Table 2 --> Shipping No.
> Order No.
> Date shipped
> Quantity shipped
>
>
> They are not into the same list because there is no one on one
> relation between those two list (ex: some delivery might have been
> back order, or that might have been some over shipment, etc...)
So "Order No" in each table is _not_ related? As in PK/FK relationship?
> Another way of looking at it would be:
>
> - Give me all Order No, where SUM(quantity requested) > SUM(quantity
> shipped).
>
> but then sum on the left side of a test is not permitted
maybe not in the WHERE clause, but you could do it with a GROUP BY and a HAVING clause Received on Fri Nov 05 2004 - 15:06:54 CST