I am looking to build a query involving multiple fact tables which share a common dimension key - can anyone shed some light on the accurate way to do this?
Eg Customer dimension table has customer_key
Orders fact table has a list of all orders, including the customer_key involved
Returns fact table has a list of all returns, including the customer_key involved.
A query such as
appears to return me one row for each matching row in orders and returns, as opposed to all orders and all returns information for each customer, which is my aim.
Any pointers appreciated
Eg Customer dimension table has customer_key
Orders fact table has a list of all orders, including the customer_key involved
Returns fact table has a list of all returns, including the customer_key involved.
A query such as
Code:
select *
from customer c,
orders o,
returns r
where c.customer_key = o.customer_key (+)
and c.customer_key = r.customer_key (+)
appears to return me one row for each matching row in orders and returns, as opposed to all orders and all returns information for each customer, which is my aim.
Any pointers appreciated