title: T-SQL remove cross pairs from table
body: <p>I have problem with removing cross pairs from table.</p>
  <p>Example table:</p>
  <pre><code>  X1     X2 
  -------------
    1       2 
    2       1
    1       2 
    3       2
    2       3
    1       3
  </code></pre>
  <p>Expected result</p>
  <pre><code>  X1     X2 
  ------------
    1       2 
    1       3
  </code></pre>
  <p>Currently I am thinking about looping through table rows and removing reference row and duplicate row if found, but maybe I can do it in one query? Any help would be welcome. Thank you.</p>