Исправление Sorcerer, 05.04.18 09:23 (текущая версия) :
SELECT some_id FROM t GROUP BY some_id HAVING BIT_OR(CASE some_flag WHEN 1 THEN 1 ELSE 2) = 2
Исходная версия Sorcerer, 05.04.18 09:21:
SELECT some_id GROUP BY some_id HAVING BIT_OR(CASE some_flag WHEN 1 THEN 1 ELSE 2) = 2