SELECT JPM_PROFILE_ID , 'E' %Concat EMPLID FROM PS_JPM_PROFILE WHERE JPM_PROFILE_USAGE='P' AND JPM_JP_PRFL_STATUS = 'A' UNION SELECT A.JPM_PROFILE_ID , 'C' %Concat B.CLASSID FROM PS_JPM_PROFILE A , PS_JPM_ROWSEC_VW B WHERE B.EMPLID=A.EMPLID AND A.JPM_PROFILE_USAGE='P' AND A.JPM_JP_PRFL_STATUS = 'A' UNION SELECT DISTINCT A.JPM_PROFILE_ID , 'M' %Concat B.SUPERVISOR_ID FROM PS_JPM_PROFILE A , PS_HR_DIRECT_REP_2 B , PS_JPMINSTALLATION C WHERE B.EMPLID=A.EMPLID AND A.JPM_PROFILE_USAGE='P' AND A.JPM_JP_PRFL_STATUS = 'A' AND C.JPM_DR_NAV_MTHD = '2' UNION SELECT DISTINCT A.JPM_PROFILE_ID , 'M' %Concat B.SUPERVISOR_ID FROM PS_JPM_PROFILE A , PS_HR_DIRECT_REP_3 B , PS_JPMINSTALLATION C WHERE B.EMPLID=A.EMPLID AND A.JPM_PROFILE_USAGE='P' AND A.JPM_JP_PRFL_STATUS = 'A' AND C.JPM_DR_NAV_MTHD = '3' UNION SELECT DISTINCT A.JPM_PROFILE_ID , 'M' %Concat B.SUPERVISOR_ID FROM PS_JPM_PROFILE A , PS_HR_DIRECT_REP_4 B , PS_JPMINSTALLATION C WHERE B.EMPLID=A.EMPLID AND A.JPM_PROFILE_USAGE='P' AND A.JPM_JP_PRFL_STATUS = 'A' AND C.JPM_DR_NAV_MTHD = '4' UNION SELECT DISTINCT A.JPM_PROFILE_ID , 'M' %Concat B.SUPERVISOR_ID FROM PS_JPM_PROFILE A , PS_HR_DIRECT_REP_5 B , PS_JPMINSTALLATION C WHERE B.EMPLID=A.EMPLID AND A.JPM_PROFILE_USAGE='P' AND A.JPM_JP_PRFL_STATUS = 'A' AND C.JPM_DR_NAV_MTHD = '5' UNION SELECT DISTINCT A.JPM_PROFILE_ID , 'M' %Concat B.SUPERVISOR_ID FROM PS_JPM_PROFILE A , PS_HR_DIRECT_REP_6 B , PS_JPMINSTALLATION C WHERE B.EMPLID=A.EMPLID AND A.JPM_PROFILE_USAGE='P' AND A.JPM_JP_PRFL_STATUS = 'A' AND C.JPM_DR_NAV_MTHD = '6'
|