title: Finding duplicates in one column that have a different code/ID in another column
body: <p>I've been fighting this one for awhile</p>
  
  <p>I have a table full of duplicate locations that I made using the following query;</p>
  
  <pre><code>select * from Table A where location in
  (select location from Table A
  group by location having count(*) &gt;1);
  </code></pre>
  
  <p>The duplicate locations should have the same code associated with them. If there is a duplicated location that has a different code compared to the others then I want to select which ones they are</p>
  
  <p>I have this example table</p>
  
  <pre><code>Table A
  code    location
  111     x12345
  111     x12345
  222     y12346
  222     y12346
  111     y12346
  222     z12348
  333     z12348
  333     r12340
  333     r12340
  </code></pre>
  
  <p>I want to select all of the duplicated locations that have a different code. So for example the output should look like this</p>
  
  <pre><code>code    location
  222     y12346
  222     y12346
  111     y12346
  222     z12348
  333     z12348
  </code></pre>