Re: join in union
Posted by:
Rick James
Date: March 28, 2010 12:33PM
SELECT user, color, piece, SUM(quantity) AS quantity -- changed
FROM (
SELECT test1_loose.user,test1_loose.color,
test1_loose.piece,test1_loose.quantity
FROM test1_loose
UNION
SELECT test2_boxes.own_user,test3_boxinv.color,
test3_boxinv.piece,
(test3_boxinv.quantity * test2_boxes.own_quantity) AS quantity
FROM test2_boxes,test3_boxinv
WHERE test2_boxes.own_item = test3_boxinv.item
) as ss
GROUP BY user, color, piece; -- added
Subject
Written By
Posted
Re: join in union
March 28, 2010 12:33PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.