table users:
id
1
2
3
table info:
id
1
2
3
table users_info:
id | user_id | info_id
1 1 1
2 1 2
3 1 3
4 2 2
5 2 3
6 3 1
7 3 2
<b>Результат должен быть:</b>
table result:
user_id
1
SELECT user_id FROM users_info WHERE info_id IN ( 2,3,1 ) GROUP BY user_id HAVING COUNT(user_id) =3