title: Compare two query results and output difference
body: <p>I have two queries against the same table:</p>
  
  <ol>
  <li>SELECT * FROM table WHERE fileName='x';</li>
  <li>SELECT * FROM table WHERE fileName='y';</li>
  </ol>
  
  <p>Now, I am trying to compare the result that is being returned by these queries. There is no ID I could compare against but I need to compare each column.</p>
  
  <p>I was trying to modify this approach, as seen <a href="https://stackoverflow.com/questions/950414/compare-differences-between-two-tables-in-mysql">here</a>:</p>
  
  <pre><code>SELECT  'robot' AS `set`, r.*
  FROM    robot r
  WHERE   ROW(r.col1, r.col2, …) NOT IN
      (
      SELECT  *
      FROM    tbd_robot
      )
  UNION ALL
  SELECT  'tbd_robot' AS `set`, t.*
  FROM    tbd_robot t
  WHERE   ROW(t.col1, t.col2, …) NOT IN
      (
      SELECT  *
      FROM    robot
      )
  </code></pre>
  
  <p>I am not sure how to modify this code correctly. My attempts to change the table names to the same table but adding a <code>WHERE</code> clause failed in SQL exceptions.</p>
  
  <p>Is this even the best route to take? Maybe there is an even more clever way to compare two query results and output the differences?</p>
  
  <p>Thank you very much for your help in advance :-)</p>
  
  <p>EDIT:</p>
  
  <p>Sample Data:</p>
  
  <pre><code>ID | fileName | firstName | lastName | address  
  1  | x.txt    | John      | Doe      | 1 Test st  
  2  | x.txt    | Jane      | Doe      | 3 Test st  
  3  | y.txt    | John      | Doe      | 2 Test st  
  4  | y.txt    | Jane      | Doe      | 3 Test st  
  </code></pre>
  
  <p>Since the address differs where ID = 3, this is the row that should be returned.</p>