clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1811884 fiddles created (25308 in the last week).

CREATE TABLE statuses (`id` INTEGER, `status` INTEGER); INSERT INTO statuses (`id`, `status`) VALUES ('1', '1'), ('1', '6'), ('1', '8'), ('1', '1'), ('2', '1'), ('2', '6'), ('2', '8'), ('2', '0'), ('3', '0'), ('3', '0'), ('3', '0'), ('3', '0');
 hidden batch(es)


SELECT id FROM statuses GROUP BY id HAVING SUM(status IN (1, 6, 8)) = 0
id
3
 hidden batch(es)


SELECT DISTINCT id FROM statuses WHERE id NOT IN (SELECT id FROM statuses WHERE status IN (1, 6, 8))
id
3
 hidden batch(es)