1

I'm currently in the process of converting data, in a table, which is why I've created a new table, identical to the old one, but empty.

I've run my data converter, and I have a difference in row count.

How do I select all rows that are different from the two tables, leaving out the primary key identifier (that differs on every entry).

Jannik
  • 401
  • 1
  • 5
  • 17
  • I generally add a temporary additional column with the primary key value of the source table. – Gimby Oct 21 '16 at 08:03

1 Answers1

0
select * from (
SELECT 'Table1',t1.* FROM table1 t1 WHERE 
(t1.id)
NOT IN (SELECT  t2.id FROM table2 t2)
UNION ALL
SELECT 'Table2',t2.* FROM table2 t2 WHERE   
(t2.id) 
NOT IN (SELECT  t1.id FROM table1 t1))temp order by id;

You can add more columns in where columns to check on more info. Try and see if this helps.

Priyanshu
  • 885
  • 6
  • 12