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
er antallet af funktioner i (1,2,3)
. Og forudsat (camera_id,feature_id)
er unik i camera_features
.