create table tbl (user_id int, entity_id int, entity_type int, entity_style int);
insert into tbl values
(1, 22, 0, 1),
(1, 23, 0, 1),
(1, 24, 0, 1),
(1, 25, 0, 1),
(2, 25, 0, 1),
(2, 24, 0, 1),
(3, 24, 0, 1);
select user_id
from tbl
where entity_id in (24, 25)
group by user_id
having count(distinct entity_id) = 2;