title: SQL: Compare rows in a same table
body: <p>I'm trying to compare rows in a single table
  and figure out if "addr" and "zip" under the same id are same or different.</p>
  
  <pre><code>  id  |   addr   |   zip
  ------+----------+----------
    1   |   123    |   0000     
    1   |   123    |   0000    
    1   |   123    |   0001    
    2   |   222    |   1000    
    2   |   221    |   1000
  </code></pre>
  
  <p>So the result should say id <em>1</em> has valid addr and invalid zip
  id <em>2</em> has invalid addr and valid zip.</p>
  
  <p>Any hint will be appreciated! Thank you!!</p>