title: How to Return One DB Row from Two That Have The Same Values In Opposite Columns Using the MAX Function?
body: <p>I have three columns in a table - ID, Column1, Column2 - with this example data:</p>
  
  <pre><code>ID  Column1 Column2
  ----------------------
  1   1       2  
  2   2       1  
  3   4       3  
  4   3       4
  </code></pre>
  
  <p>Since, in the first two rows, Column1 and Column2 have the same values (but in different columns), I want my MAX query to return an ID of 2.  Same thing with rows 3 and 4 .... since Columns 1 and 2 have the same values (but in different columns), I want MAX(ID) to return 4.  Of course, with MAX, you use Group By, but that will not work in my case.</p>
  
  <p>In effect, I need a Group By to work across two columns.  <b>Is this possible?</b>  If not, what's the best way to accomplish getting the IDs of 2 and 4 given the matching values that are in different columns?</p>