title: Return unique row only - TSQL
body: <p>I have a customer table and order tables. In customer table we have 'Family link' column which is a given ID to each customer. e.g. familyLink: A121, if this customer has a family member in the table they will have this ID too : A121. Basically I need to return all customers with no family members and have made an order_number 2 or 3</p>
  
  <p><code>Customer</code> table:</p>
  
  <pre><code>CustmID(PK), Name(varchar), familyLink(varchar).
  </code></pre>
  
  <p><code>Order</code> table:</p>
  
  <pre><code>OrderID(PK), order_number (varchar), CustmID(FK)
  </code></pre>
  
  <p>The query I've return which didn't seem to return customers with no family member..</p>
  
  <pre><code>Select Distinct 
      c.familyLink,
      c.name,
      o.order_number
  From 
      Customer c
  Left join 
      Order o on c.CustmID = o.CustmID
  where 
      (o.order_number = 2 or order_number=3)
  </code></pre>
  
  <p><strong>Examples:</strong></p>
  
  <p>Customer table</p>
  
  <pre><code>Custm ID   Name   FamilyLink
  C1         Liam     A11
  C2         Lucy     A12
  C3         David    A11
  C4         Suzy     A13
  </code></pre>
  
  <p>Orders table</p>
  
  <pre><code>OrderID    Order_Number     CustmID
  O1           2               C1
  O2           3               C2
  O3           2               C4
  </code></pre>
  
  <p><strong>Results`</strong>
  This query should return Lucy and Suzy because they don't have any family members in the customer table..</p>
  
  <p>Any idea why this is returning customers who share familyLink?</p>
  
  <p>Any help appreciated.</p>