title: Sql server combine multiple data sets without duplicate data
body: <p>Given three tables Ta, Tb, Tc:<br></p>
  
  <pre><code>Ta(ID, Field1)
  Tb(ID, Field2)
  Tc(ID, Field3)
  </code></pre>
  
  <p>Given data example:</p>
  
  <pre><code>Ta
  ID Field1
  ---------
  1  A
  1  B
  
  Tb
  ID Field2
  ---------
  1  C
  1  D
  2  E
  
  Tc
  ID Field3
  ---------
  1  F
  2  G
  2  H
  </code></pre>
  
  <p><strong>Question:</strong>
  How can I join this data to return:</p>
  
  <pre><code>ID Field1 Field2 Field3
  -----------------------
  1  A      C      F
  1  B      D      NULL
  2  NULL   E      G
  2  NULL   NULL   H
  </code></pre>
  
  <p>I thought I could achieve this with outer joins but that doesn't seem to be the case. The order of the groupings doesn't really matter, as long as I bring back all information without duplicate rows.</p>
  
  <p><strong>Just to clarify.</strong> I don't really mind which combination I get as long as the result set returns all data in the minimum number of rows. Here's a more realistic example of what I am trying to do:</p>
  
  <p>Given a person, call him John. He has two phone numbers and three email addresses:</p>
  
  <pre><code>PID  Email
  ---------
  John john@test.com
  John john@mail.com
  John john@john.com
  
  PID  Tel
  --------
  John 011
  John 022
  </code></pre>
  
  <p>I want to return:</p>
  
  <pre><code>PID  Email         Tel
  ----------------------
  John john@test.com 011
  John john@mail.com 022
  John john@john.com NULL
  </code></pre>