title: SQL query result from multiple tables without duplicates
body: <p>I have a number of tables with filtered from all the records customer ID's, Last Order Date and that order Total $, Segment Name. Each filter is based on different criteria but, same customer ID can belong two different tables, two different segments. Same ID would have different values in Last Order and Total in . Segments, table names are A, B, C, D.</p>
  
  <p>I need to group the records from All the segment tables in a way that there are no duplicate ID's in the set. i.e.: if an ID appears in more than one table (say ID 2 is in tables A and B) the result set has to be showing ID columns from the first table, table A. </p>
  
  <p>So I need to list of all the records and their column values from Segment A table, list of all the records and its values from Segment B table except if any ID in Segment B table is in Segment A and list of all the records from Segment C table except if ID from Segment C are in Segment A or B table . I hope it does makes sense. </p>
  
  <p>I made it sound like a question from 70-461 exam :D I've researched it quite thoroughly but perhaps I don't see how to ask that questions. I wonder if anyone would have idea of how to build a query to get that result.  Big thanks for any suggestions.</p>
  
  <p>Thanks guys. I couldn't seem to post a screenshot. Let me try to type it via html. There are more segment tables but just typing two to give you an idea. Thanks guys!</p>
  
  <pre><code>Segment A
  ----------------------------------------
  ID | Last Order Date  | Total  | Segment     
  ----------------------------------------
  1  | 01/01/2012       | $1     |  A         
  ----------------------------------------
  2  | 01/01/2012       | $1     |  A     
  ----------------------------------------              
  3  | 01/01/2012       | $5     |  A     
  ----------------------------------------                 
  6  | 01/01/2012       | $7     |  A     
  ----------------------------------------                 
  8  | 01/01/2012       | $8     |  A  
  
  
  Segment B
  
  ID | Last Order Date | Total | Segment     
  --------------------------------------
  4  | 01/01/2010      | $3    |  B        
  --------------------------------------
  2  | 01/01/2010      | $5    |  B     
  --------------------------------------            
  1  | 01/01/2010      | $2    |  B     
  --------------------------------------                
  3  | 01/01/2010      | $1    |  B     
  --------------------------------------                
  5  | 01/01/2010      | $7    |  B  
  
  
  
  Result Set
  
  ID | Last Order Date | Total | Segment
  --------------------------------------     
  1  |    01/01/2012   |  $1   |    A         
  --------------------------------------
  2  |    01/01/2012   |  $1   |    A   
  --------------------------------------                
  3  |    01/01/2012   |  $5   |    A   
  --------------------------------------                  
  4  |    01/01/2010   |  $3   |    B   
  --------------------------------------      
  5  |    01/01/2010   |  $7   |    B  
  </code></pre>