**Table A** 1 2 3 4 5 6 **Table B** 2 3 5
How can I select for entry IDs that only exist in Table B? In this example, I\'m looking for a query th
Assuming the column is named 'id', either:
SELECT * FROM tableA a WHERE NOT EXISTS (SELECT 1 FROM tableB WHERE id = a.id)
or
SELECT * FROM TableA WHERE id NOT IN (SELECT id FROM tableB)
You will probably need to test to see which performs best. MySQL can be a bit unpredictable.