कैसा रहेगा
SELECT *
FROM team t
JOIN team_user tu ON (tu.id_team = t.id)
GROUP BY t.id
HAVING (SUM(tu.id_user IN (1,5)) = 2) AND (SUM(tu.id_user NOT IN (1,5)) = 0)
मैं Team_user(id_team, id_user) पर एक अद्वितीय अनुक्रमणिका मान रहा हूं।
कैसा रहेगा
SELECT *
FROM team t
JOIN team_user tu ON (tu.id_team = t.id)
GROUP BY t.id
HAVING (SUM(tu.id_user IN (1,5)) = 2) AND (SUM(tu.id_user NOT IN (1,5)) = 0)
मैं Team_user(id_team, id_user) पर एक अद्वितीय अनुक्रमणिका मान रहा हूं।