SELECT DISTINCT C.VENDOR_SETID AS SETID ,B.PERSON_ID ,B.NAME ,C.VENDOR_ID FROM PS_SPF_WORDERREC A , PS_SPB_PERSON_TBL B , PS_SPB_SERVICE_PRV C WHERE B.PERSON_ID = A.WO_CONID AND A.SERVICE_METHOD = 'R' AND A.SP_TRACK_RESRC = 'N' AND C.PERSON_ID = B.PERSON_ID AND C.SP_FUNCTION_TYPE IN ('PROV','INDP') UNION SELECT DISTINCT C.VENDOR_SETID AS SETID ,B.PERSON_ID ,B.NAME ,C.VENDOR_ID FROM PS_SPF_WORDERREC A , PS_SPF_WO_TRK_RSRC T , PS_SPB_PERSON_TBL B , PS_SPB_SERVICE_PRV C WHERE A.SERVICE_METHOD = 'D' AND A.SP_TRACK_RESRC = 'Y' AND T.BUSINESS_UNIT = A.BUSINESS_UNIT AND T.WORK_ORDER_ID = A.WORK_ORDER_ID AND B.PERSON_ID= T.PERSON_ID AND C.PERSON_ID = B.PERSON_ID AND C.SP_FUNCTION_TYPE IN ('PROV','INDP')
|