Outer Join

From: The Magnet <art_at_unsu.com>
Date: Thu, 10 Feb 2011 07:38:00 -0800 (PST)
Message-ID: <9b65be0e-39b8-4c51-a093-54c73cd0ef97_at_o39g2000prb.googlegroups.com>



Hi,

Been trying for a couple of hours to do this. Here is my query:

SELECT data..........
FROM customer c, customer_account ca, customer_address cd, customer_order co, order_details od

WHERE c.customer_id = ca.customer_id(+)
  AND c.customer_id = cd.customer_id(+)
  AND c.customer_id = co.customer_id(+)

  AND co.order_id = od.order_id;

The idea is this:
- The customer may or many not have an account record (outer join)

  • The customer may or may not have an address record (outer join)
  • The customer may or may not have an order record (outer join)

BUT, if the customer DOES have an order record, then he WILL have an order details record.

Not sure how to code that. Can anyone help? I'm going to keep trying.......

Thanks! Received on Thu Feb 10 2011 - 09:38:00 CST

Original text of this message