SELECT DISTINCT D.OPRCLASS , B.INSTITUTION , B.AID_YEAR , A.EMPLID , A.NAME , D.NATIONAL_ID , D.NATIONAL_ID_MSK FROM PS_SCC_PRI_NAME_VW A , PS_STDNT_AWARDS B , PS_ITEM_TYPE_FA C , PS_FA_NID_VW D WHERE A.EMPLID = B.EMPLID AND B.FIN_AID_TYPE = 'L' AND ((B.OFFER_ACTIVITY_IND IN( 'U','A') AND B.AWARD_STATUS = 'A') OR (B.OFFER_ACTIVITY_IND IN ('A') AND B.AWARD_STATUS = 'C') OR EXISTS ( SELECT 'X' FROM PS_LOAN_ORIG_DTL X WHERE X.EMPLID = B.EMPLID AND X.LOAN_PROC_STAT = 'S' AND X.LN_ORIG_TRANS = 'E' )) AND C.SETID = B.SETID AND C.ITEM_TYPE = B.ITEM_TYPE AND C.AID_YEAR = B.AID_YEAR AND C.EFFDT = ( SELECT MAX(X.EFFDT) FROM PS_ITEM_TYPE_FA X WHERE X.SETID = C.SETID AND X.ITEM_TYPE = C.ITEM_TYPE AND X.AID_YEAR = C.AID_YEAR) AND C.LOAN_PROGRAM <> 'D' AND A.EMPLID= D.EMPLID AND A.EFFDT = ( SELECT MAX(X1.EFFDT) FROM PS_SCC_PRI_NAME_VW X1 WHERE X1.EMPLID = A.EMPLID)
|