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.
    
        
            
                
                    
                        
                            
                                | Author | 
                                
                                 Topic  | 
                             
                            
                                    | 
                                         Ratz03 
                                        Starting Member 
                                         
                                        
                                        27 Posts  | 
                                        
                                        
                                            
                                            
                                             Posted - 2015-02-01 : 15:30:32
                                            
  | 
                                             
                                            
                                            | I am doing a reconciliation report for records from 2 systems A and B. I am storing all recording in from System A and System B in a single table.egTable RecSource Name Number AgeA      XYZ   12    33A      ABC    34   6A      uyg   87    77B      XYZ   12    33B      ABC    34   6B      iii   22   7and write a query likeSelect t1.Source, t2.source,t1.Name, t2.name,t1.number, t2.number,t1.age, t2 agefrom rec t1  left join rec t2on t1.name = t2.namewhere t1.source = A and t2.source = BThis returns me all records in source A and B. However I need all records from table rec, that is records in A and not in B and records in B and not in A. Require help in how to retrieve it from table rec. I am able to do it from 2 individual tables for A and B but requirenent is to do it from table rec.Thanks for your suggestions in advance. | 
                                             
                                         
                                     | 
                             
       
                            
                       
                          
                            
                                    | 
                                     sqllover 
                                    Constraint Violating Yak Guru 
                                     
                                    
                                    338 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2015-02-01 : 18:52:38
                                          
  | 
                                         
                                        
                                          | Hi,Can you please post test data in terms of table format with test result to help you out.  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                       
                          
                            
                                    | 
                                     madhivanan 
                                    Premature Yak Congratulator 
                                     
                                    
                                    22864 Posts  | 
                                    
                                      
                                        
                                          
                                           
                                            Posted - 2015-02-02 : 01:11:12
                                          
  | 
                                         
                                        
                                          | You may need to use FULL OUTER JOINMadhivananFailing to plan is Planning to fail  | 
                                         
                                        
                                            | 
                                         
                                       
                                     | 
                                   
                            
                            
                                | 
                                    
                                      
                                     
                                    
                                 | 
                             
                         
                     | 
                 
             
         |