title: SQL : Flag multiple records with duplicate values but in alternate columns
body: <p>I have a problem. I have SQL table which has two variables but duplicated alternatively.
  So if we have a table</p>
  
  <pre><code>A_ID   OTHER_ID   
  1111      2222   
  2222      1111    
  0000      0101  
  3333      5555   
  5555      3333
  </code></pre>
  
  <p>I want a unique table </p>
  
  <pre><code>A_ID   OTHER_ID       
  1111    2222          
  0000    0101   
  3333    5555
  </code></pre>
  
  <p>Or,</p>
  
  <pre><code>A_ID   OTHER_ID  FINAL_ID   
  1111    2222     2222      
  2222    1111     2222          
  0000    0101     0101        
  3333    5555     3333     
  5555    3333     5555
  </code></pre>
  
  <p>Thanks.</p>