title: MySQL - Swap values of two columns in a row
body: <p>I'm trying to correct some data in a table which stores two years:</p>
  
  <pre><code>id | start_year | end_year
  ---|------------|---------
  1  |    2001    |   2003
  2  |    2008    |   2005
  3  |    2004    |   2010
  4  |    2012    |   NULL
  5  |    2003    |   2004
  </code></pre>
  
  <p>Like in row 2 the years are the wrong way round. How can I swap the values of those columns, on rows where <code>start_year &gt; end_year</code>?</p>
  
  <p><strong>Note:</strong> row 4 should not be swapped, where <code>end_year</code> is NULL. That should remain the same.</p>