title: SQL to compare two columns where a third column is constant and return differences
body: <p>I need to compare two descriptions fields in a table where another field (group) is constant and return all rows if there is description data that does not match. </p>
  
  <p>For example if I have this table:</p>
  
  <pre><code>Chart   Group   Desc1   Desc2
   1      11111     a       b
   2      11111     a       x
   1      22222     z       h
   2      22222     z       h
   5      22222     u       h
   1      55555     j       p
   3      55555     j       p
   4      55555     j       p
  </code></pre>
  
  <p>I need to return all rows where the Group value is the same and either Desc1 or Desc2 is different than the rest of the Description values for the same group. My return would be:</p>
  
  <pre><code>Chart   Group   Desc1   Desc2
   1      11111     a       b
   2      11111     a       x
   1      22222     z       h
   2      22222     z       h
   5      22222     u       h
  </code></pre>
  
  <p>I was trying to do some sort of select distinct and I'm failing miserably... Thanks for any help!</p>