I have a set of values(keys), 1,2,3,4,5 and following table:
id key
------
1 2
2 8
3 4
If I need to check which of the given keys are in db, I use:
SELECT *
FROM mytable
WHERE key IN (1,2,3,4,5)
So I'd get rows with keys 2 and 4.
Is there some sort of mysql way of finding out which of the given keys are NOT in db? So in this case I'd like to get 1,3,5.