Kôd:
select * from properties p where 1 = 1
and exists(select * from amenities_properties ap where ap.property_id = p.id and ap.amenity_id = 9)
and exists(select * from amenities_properties ap where ap.property_id = p.id and ap.amenity_id = 15)
and exists(select * from amenities_properties ap where ap.property_id = p.id and ap.amenity_id = 24)