title: SQL -- Remove duplicate pairs
body: <p>I'm using an SQLite to store a set of <strong>undirected</strong> edges of a graph using two columns, u and v. For example:</p>
  
  <p>u       v</p>
  
  <p>1       2</p>
  
  <p>3       2</p>
  
  <p>2       1</p>
  
  <p>3       4</p>
  
  <p>I have already been through it with SELECT DISTINCT * FROM edges and removed all duplicate rows.</p>
  
  <p>However, there are still duplicates if we remember these are undirected edges. In the above example, the edge (1,2) appears twice, once as (1,2) and once as (2,1) which are both equivalent.</p>
  
  <p>I wish to remove all such duplicates leaving only one of them, either (1,2) or (2,1) -- it doesn't really matter which.</p>
  
  <p>Any ideas how to achieve this? Thanks!</p>