1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| select b3.elt_db_id Prog, -- le parent PRG
b1.pu_db_id Proj, -- le PU
p.proj_id projOID, -- identifiant du PU provenant d'une autre table
b2.orig_pu_db_id Origin, -- 1 champ du PU
b1.elt_db_id Act, -- la TASK
count(tr.taskrsrc_id) nbRA -- le nombre de sous elements de la TASK
from bi_wbs b3, -- la table pour le PRG
bi_wbs b1 JOIN projwbs p ON b1.pu_db_id = p.wbs_id -- identifiant PU autre table
INNER JOIN bi_wbs b2 ON b1.pu_db_id = b2.elt_db_id -- pour le champ origin du PU
JOIN taskrsrc tr ON b1.elt_db_id = tr.task_id -- ss elt de task
where b1.elt_type='TASK'
and tr.delete_date IS NULL
and p.delete_date IS NULL
and b3.elt_db_id = (select elt_db_id
from bi_wbs b4
where b4.elt_type = 'PRG'
start with b4.elt_db_id = b1.elt_db_id
connect by prior b4.elt_parent_db_id = b4.elt_db_id ) -- le truc pour récupérer le PRG
group by b3.elt_db_id,
b1.pu_db_id,
p.proj_id,
b2.orig_pu_db_id,
b1.elt_db_id
order by prog,proj,act |
Partager