SELECT A.EQTN_ID_AUTH_CLASS , A.EQUATION_NAME , A.DESCR , X.XLATLONGNAME FROM PS_EQTX_ID_WRI_SEC A , PS_EQUATION_TBL A2 , PSXLATITEM X WHERE A2.EQUATION_NAME = A.EQUATION_NAME AND A2.EFFDT = ( SELECT MAX(A3.EFFDT) FROM PS_EQUATION_TBL A3 WHERE A3.EQUATION_NAME = A2.EQUATION_NAME AND A3.EFFDT <= %CurrentDateIn ) AND X.FIELDNAME = 'SCC_DATA_TYPE_CD' AND X.FIELDVALUE = A2.SCC_DATA_TYPE_CD AND X.EFFDT = ( SELECT MAX(X2.EFFDT) FROM PSXLATITEM X2 WHERE X2.FIELDNAME = X.FIELDNAME AND X2.FIELDVALUE = X.FIELDVALUE AND X2.EFFDT <= %CurrentDateIn )
|