title: Is the query acting like it should?
body: <p>Yesterday I posted the question below: </p>
  
  <p>"""</p>
  
  <p>Here is a simplified version of my table:</p>
  
  <p>It contains the columns
  <code>employee_id  column2  column3   x   y</code>
  and they are all <code>NUMERIC</code></p>
  
  <p>I am having trouble writing a complicated MySQL query. I want to get all the <code>employeeid</code> and <code>column3</code> values for all employees that have the same value in <code>column2</code> as another employee and have DIFFERENT values for <code>x</code> and <code>y</code> PAIR from every other employee. For example, if the following 4 rows were in table:</p>
  
  <pre><code>2 100 123.456 5 7
  1 234 123.456 5 7
  3 100 456.789 5 10
  4 100 123.456 5 7
  </code></pre>
  
  <p>The rows <code>2 100 123.456 5 7</code> and <code>3 100 456.789 5 10</code> should be obtained because they have different employee ids (<code>2</code> vs <code>3</code>), the same value for <code>column2</code> (<code>100</code> and <code>100</code>), and different <code>x</code>, <code>y</code> pair: (Employee 2 has <code>x</code> = 5 and <code>y</code> = 7, which is distinct from <code>x</code> = 5 and <code>y</code> = 10). </p>
  
  <p>How can I compare the documents of table with other documents within itself?</p>
  
  <p>"""</p>
  
  <p>Somebody responded with the following query, which I adapted for my table:</p>
  
  <pre><code>SELECT truncate(column2, 2)
  from TABLE t1
  JOIN TABLE t2
  ON t1.id &lt;&gt; t2.id
  AND t1.TIV_2011 = t1.TIV_2011
  AND (t1.X &lt;&gt; t2.X OR t1.X &lt;&gt; t2.Y)
  </code></pre>
  
  <p>I am still not getting the result I expect, so I'm wondering if this query is doing what I think it's doing or if it's missing something. </p>