SELECT id
FROM table
WHERE value IN ('green', 'orange', 'black')
AND id NOT IN (
SELECT id
FROM table
WHERE value NOT IN ('green', 'orange', 'black'))
SELECT id
FROM table
WHERE value IN ('green', 'orange', 'black')
AND id NOT IN (
SELECT id
FROM table
WHERE value NOT IN ('green', 'orange', 'black'))