SELECT A.SETID , A.MFG_ID , A.MODEL , ( SELECT 'Y' FROM PS_INSTALLATION WHERE EXISTS ( SELECT 'X' FROM PS_WM_WO_RQMT_TOOL RT , PS_WM_WO_TSK T1 WHERE A.SETID = ( SELECT S1.SETID FROM PS_SET_CNTRL_REC S1 WHERE S1.SETCNTRLVALUE = RT.BUSINESS_UNIT AND S1.REC_GROUP_ID = 'FS_18' AND S1.RECNAME = 'MFG_MODEL') AND RT.MFG_ID = A.MFG_ID AND RT.MODEL = A.MODEL AND T1.BUSINESS_UNIT = RT.BUSINESS_UNIT AND T1.WO_ID = RT.WO_ID AND T1.WO_TASK_ID = RT.WO_TASK_ID AND T1.INTERNAL_STATUS <> '06') OR EXISTS ( SELECT 'X' FROM PS_WM_WO_SCHED_TLS ST , PS_WM_WO_TSK T2 WHERE A.SETID = ( SELECT S2.SETID FROM PS_SET_CNTRL_REC S2 WHERE S2.SETCNTRLVALUE = ST.BUSINESS_UNIT AND S2.REC_GROUP_ID = 'FS_18' AND S2.RECNAME = 'MFG_MODEL') AND ST.MFG_ID = A.MFG_ID AND ST.MODEL = A.MODEL AND T2.BUSINESS_UNIT = ST.BUSINESS_UNIT AND T2.WO_ID = ST.WO_ID AND T2.WO_TASK_ID = ST.WO_TASK_ID AND T2.INTERNAL_STATUS <> '06')) AS IN_USE_FLAG FROM PS_MFG_MODEL A
|