SELECT userid FROM user_options WHERE optionid IN (2, 3) GROUP BY userid HAVING COUNT(*) = 2
SELECT o1.userid FROM user_options o1
INNER JOIN user_options o2 ON o1.userid = o2.userid AND o2.optionid = 3
WHERE o1.optionid = 2
SELECT
a.userid
FROM
user_options a,
user_options b
WHERE a.userid = b.userid
AND a.optionid=2
AND b.optionid=3
GROUP BY a.userid
SELECT user_id FROM user_option GROUP BY user_id HAVING GROUP_CONCAT(DISTINCT option_id ORDER BY user_id ASC SEPARATOR ',') = '1,2,3,4,5';