title: SQL outer Join 3 tables merging data
body: <p>I would like to join 3 tables together and have it return the data where the results from one would be null.</p>
  
  <p>tblCustomer is the main table that will always have the required result. It would then be tied to 2 other tables tblEvents and tblPending and should return with the data for either.</p>
  
  <p>Example</p>
  
  <pre><code>tblCustomer.CustomerID       tblEvents.EventID      tblPending.PendingID
  1                            50                     NULL
  1                            51                     NULL
  2                            NULL                   30
  2                            70                     NULL
  2                            NULL                   90
  </code></pre>
  
  <p>I've tried outer joining the tables like so:</p>
  
  <pre><code>dbo.tblEvents 
  LEFT OUTER JOIN dbo.tblCustomer 
    ON dbo.tblEvents.CustomerID = dbo.tblCustomer.CustomerID 
  LEFT OUTER JOIN dbo.tblPending 
    ON dbo.tblCustomer.CustomerID = dbo.tblPending.CustomerID
  </code></pre>
  
  <p>But it gives me results like this:</p>
  
  <pre><code>  CustomerID     EventID      PendingID
    2              70           30
    2              70           90
  </code></pre>
  
  <p>Is there a simple way to make it joins to the Customer table but does not try to join to the additional table. IE there is no relationship between Pending and Event except they are both related to Customer.</p>