SELECT DISTINCT A.BUSINESS_UNIT , A.PROJECT_ID , D.BUSINESS_UNIT , D.CONTRACT_NUM , %Substring(A.TEAM_MEMBER, 1, 11) FROM PS_PROJECT_TEAM A , PS_GM_PT_ACCESS B , PS_CA_DETAIL_PROJ C , PS_CA_CONTR_HDR D WHERE A.TEAM_MEMBER_CLASS = 'L' AND A.TEAM_MEMBER_IND = 'E' AND A.PLAN_PROJROLE = B.PROJ_ROLE AND B.PROJECT_FLG = 'Y' AND B.ACCESS_CD <> 'N' AND C.BUSINESS_UNIT_PC = A.BUSINESS_UNIT AND C.PROJECT_ID = A.PROJECT_ID AND D.CONTRACT_NUM = C.CONTRACT_NUM UNION SELECT DISTINCT A.BUSINESS_UNIT , A.PROJECT_ID , ' ' , ' ' , %Substring(A.TEAM_MEMBER, 1, 11) FROM PS_PROJECT_TEAM A , PS_GM_PT_ACCESS B WHERE A.TEAM_MEMBER_CLASS = 'L' AND A.TEAM_MEMBER_IND = 'E' AND A.PLAN_PROJROLE = B.PROJ_ROLE AND B.PROJECT_FLG = 'Y' AND B.ACCESS_CD <> 'N' UNION SELECT DISTINCT A2.BUSINESS_UNIT_PC , A2.PROJECT_ID , D2.BUSINESS_UNIT , D2.CONTRACT_NUM , C2.EMPLID FROM PS_CA_DETAIL_PROJ A2 , PS_GM_PT_ACCESS B2 , PS_GM_PRJ_DEPT C2 , PS_GM_AWARD D2 WHERE B2.PROJ_ROLE = 'DPTC' AND B2.PROJECT_FLG = 'Y' AND B2.ACCESS_CD <> 'N' AND C2.BUSINESS_UNIT = A2.BUSINESS_UNIT_PC AND C2.PROJECT_ID = A2.PROJECT_ID AND D2.CONTRACT_NUM = A2.CONTRACT_NUM AND D2.DEPTID = C2.DEPTID
|