XOR two tables in MySQL
Published by Nicholas Dunbar on December 13th, 2012
SELECT ot.id FROM old_table ot LEFT JOIN new_table nt ON ot.id=nt.id WHERE nt.id IS NULL
Only return that which they don't have in common.
Another way of saying it is only return where they do not intersect.
There are many Boolean operations that can be performed on sets.
Here is a list of examples, including the "exclusive-or" (XOR) operation:
source:
http://geoportal.icimod.org/UserFiles/Image/capacity%20building/elearning/Figure%207_1.jpg