I have 3 tables. Two tables (par1, par1) both refer (child_id) to an id in the 3rd table (child).
I like to find orphans in the 3rd table, i.e. records that are not referenced by either of the other two tables.
If I had only once referencing table, I could write:
SELECT * FROM child WHERE id NOT IN (SELECT child_id FROM par1)
But how do I solve this for two referencing tables?
I'm using sqlite.