select id not in other table code example Example: select from one table where not on the other SELECT id FROM a.table WHERE id NOT IN (SELECT b.id FROM b.id)