1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
SELECT
projet_affaire.id_projet_affaire,
paff_titre,
paff_description,
jh_fait,
jh_raf,
jh_vendus
FROM projet_affaire
LEFT JOIN
(SELECT id_projet_affaire, SUM(ai_duree) AS jh_fait
FROM activite_interne
GROUP BY id_projet_affaire
) AS activite_interne_temp
ON activite_interne_temp.id_projet_affaire = projet_affaire.id_projet_affaire
LEFT JOIN
(
SELECT SUM(pae_nb_jh_raf) AS jh_raf, SUM(pae_nb_jh_vendu) AS jh_vendus, id_projet_affaire
FROM projet_etape
LEFT JOIN projet_action_etape ON projet_action_etape.id_projet_etape= projet_etape.id_projet_etape
GROUP BY id_projet_affaire
) AS etape_temp
ON etape_temp.id_projet_affaire = projet_affaire.id_projet_affaire; |
Partager