Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 nested outer join problem.

Author  Topic 

chearn
Starting Member

3 Posts

Posted - 2001-06-22 : 14:20:36
SELECT *
FROM (customers LEFT OUTER JOIN orders
ON customers.customer_id = orders.order_customer) LEFT OUTER JOIN members
ON customers.customer_member = members.member_id
WHERE member_status = 1

This outer join only returns customers that are members and have member_status = 1...what I need is to return ALL customers and THEN any customer that is a member where the member_status = 1, I want to somehow put that WHERE clause on the outside join in this example, not the whole thing.

Basically, my result should be all customers (and any orders they have) and if that customer is a member also, it should should only active members.

Any ideas?

   

- Advertisement -