SELECT camera.id
FROM camera JOIN camera_features ON camera.id=camera_features.camera_id
GROUP BY camera.id
HAVING sum(camera_features.feature_id IN (1,2,3))=3
3
е броят на функциите в (1,2,3)
. И ако приемем (camera_id,feature_id)
е уникален в camera_features
.