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
| select
Sum(case when uc.udf_c10 in ('Y','N') then 1 else 0 end) as NB_ok
,count(c.cmpnt_name) as NB_Tot
--,XXXXXXXXXXXXXXXXX as %_Remp
from
plant p
,plant_area pa
,plant_area_unit pau
,tp_view_full_wiring_10level W10
,loop l
,component c
,udf_component uc
where
c.plant_id=p.plant_id
and c.area_id=pa.area_id
and pa.area_id = pau.area_id
and l.unit_id = pau.unit_id
and l.loop_id = c.loop_id
and c.unit_id=pau.unit_id
and c.cmpnt_id=uc.cmpnt_id
and c.cmpnt_name = W10.group_name (+)
and W10.sequence_follow_up in ('CAB_ ','CAB_ _ ','CAB_CAB ','Fld_ ','Fld_CAB ','Fld_CAB_MR ','Fld_Fld ','Fld_JB ','Fld_JB_ ','Fld_JB_CAB ','Fld_JB_JB_ ','Fld_MR ','JB_ ','JB_JB_ ','MR_ ')
; |
Partager