SELECT DISTINCT OPR.OPRID , SEC.EMPLID FROM %Table(SJT_PERSON) SEC , %Table(PSOPRDEFN) OPR , %Table(SJT_CLASS_ALL) CLS , %Table(SJT_OPR_CLS) SOC WHERE SEC.APPT_TYPE <> '1' AND SEC.FUTURE_FLG <> 'Y' AND CLS.SCRTY_TYPE_CD = SEC.SCRTY_TYPE_CD AND CLS.SCRTY_KEY1 = SEC.SCRTY_KEY1 AND CLS.SCRTY_KEY2 = SEC.SCRTY_KEY2 AND CLS.SCRTY_KEY3 = SEC.SCRTY_KEY3 AND SOC.OPRID = OPR.OPRID AND SOC.CLASSID = CLS.CLASSID AND CLS.SCRTY_SET_CD = 'PPLJOB' AND (CLS.TREE = 'N' OR (CLS.TREE = 'Y' AND SOC.CLASSID = OPR.ROWSECCLASS AND SOC.SEC_RSC_FLG IN ('1', '3')))
|