title: Compare two rows and identify columns whose values are different
body: <p><strong>The Situation</strong></p>
  
  <p>We have an application where we store machine settings in a SQL table. When the user changes a parameter of the machine, we create a "revision", that means we insert a row into a table. This table has about 200 <strong>columns</strong>. 
  In our application, the user can take a look on each revision.</p>
  
  <p><strong>The Problem</strong></p>
  
  <p>We want to highlight the parameters that have changed since the last revision.</p>
  
  <p><strong>The Question</strong></p>
  
  <p>Is there an SQL-only way to get the column names of the differences between two rows?</p>
  
  <p><strong>An Example</strong></p>
  
  <pre><code>ID | p_x | p_y | p_z
  --------------------
  11 | xxx | yyy | zzz
  
  12 | xxy | yyy | zzy
  </code></pre>
  
  <p>The query should return <code>p_x</code> and <code>p_z</code>.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>The table has 200 columns, not rows...</p>
  
  <p><strong>MY WAY OUT</strong></p>
  
  <p>My intention was to find a "one-line-SQL-statement" for this problem.</p>
  
  <p>I see in the answers below, it's kind a bigger thing in SQL.
  As there is no short, SQL-included solution for this problem, solving it in the backend of our software (c#) is of course much easier!</p>
  
  <p>But as this is not a real "answer" to my question, I don't mark it as answered.</p>
  
  <p>Thanks for the help.</p>