SELECT O.Order_ID,
O.Order_Date, C.Name Customer, L.Type, L.Cost, L.Quantity Qty, I.Name Item
FROM Orders O, Order_Lines L, Items I, Customers C
WHERE
O.Customer_ID = :B1
AND
L.Order_ID = O.Order_ID
AND I.Item_ID(+) =
L.Item_ID
AND
NVL(I.Org_ID,:B2) = :B2
AND
C.Customer_ID = O.Customer_ID;
•It is almost certainly wrong in the (possibly
very rare) case where there are matching Items, but they all have the wrong Org_IDs!