SELECT cnt1.produit, cnt1.count1, cnt2.count2
FROM
(SELECT cs1.produit_c produit, COUNT(c1.id) count1
FROM cases c1, cases_cstm cs1
WHERE c1.team_set_id IN (SELECT team_set_id FROM team_sets_teams WHERE team_id IN (liste de teams1) AND cs1.statuttraitement_c IN (liste de statuts) AND c1.deleted=0 and c1.id = cs1.id_c
GROUP BY cs1.produit_c) cnt1
JOIN
(SELECT cs2.produit_c produit, COUNT(c2.id) count2
FROM cases c2, cases_cstm cs2
WHERE c2.team_set_id IN (SELECT team_set_id FROM team_sets_teams WHERE team_id IN (liste de teams2)) AND cs2.statuttraitement_c IN (liste de statuts) AND c2.deleted=0 and c2.id = cs2.id_c
GROUP BY cs2.produit_c) cnt2 ON cnt2.produit = cnt1.produit |