I have two tables
Table A:
ID 1 2 3 4
Table B:
ID 1 2 3
I have two requests:
This would select 4 in your case
SELECT ID FROM TableA WHERE ID NOT IN (SELECT ID FROM TableB)
This would delete them
DELETE FROM TableA WHERE ID NOT IN (SELECT ID FROM TableB)