I have two tables with a lot of data. I have to compare them and find out if there are data in table 1 that does not exist in table 2.
Well. I could use this script:
SELECT
name
FROM
table1
WHERE
name NOT IN (SELECT name FROM table2)
But since it´s a lot of data in those tables, it will take a while. This script will do it faster:
SELECT
tbl2.name
FROM
table1 tbl1
RIGTH OUTER JOIN table2 tbl2 ON tbl1.name = tbl2.name
WHERE
tbl1.name IS NULL