Решил задачу
SELECT a.id, u.`group`, u.`id`, a.*
FROM `ankets` a
INNER JOIN anket_group ag ON ag.anketa = a.id AND ag.`status` = '1' AND (ag.`group` = '3' OR ag.`group` = '5')
LEFT JOIN `anket_user` au ON au.`anketa` = a.`id` AND au.`status` = '1' AND (SELECT COUNT(*) FROM `users` us WHERE us.id = au.`user` AND (us.`group` = '3' || us.`group` = '5')) > '0'
LEFT JOIN `users` u ON u.`id` = au.`user`
WHERE a.`delete` = 0 AND a.`status` = 2 AND u.`group` IS NULL GROUP BY a.`id`