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
While this is a very messy solution it does work:
select v.val from ( select 1 as val union select 2 as val union select 3 as val union select 4 as val union select 5 as val ) v WHERE v.val NOT IN( SELECT `key` FROM mytable WHERE key IN (1,2,3,4,5) );