Help for this page
SELECT events.b_g FROM events WHERE events.b_g NOT IN ((SELECT otf.b_g FROM otf) UNION (SELECT requests.b_g FROM requests))
# insert all of the values you want to test with IN INSERT INTO temp (id, value) VALUES (?, ?); ... # might just rollback instead of deleting if the inserts # were never commited. DELETE FROM temp where id=?;