SELECT M.LM_ADHC_LRN_ID , MLNG.LANGUAGE_CD , SLNG.LM_ADHC_TYPE , MLNG.LM_PRVD_BY , MLNG.LM_SUP_BY , MLNG.LM_FRE_FLD_FOUR , MLNG.LM_FRE_FLD_ONE , MLNG.LM_FRE_FLD_THREE , MLNG.LM_FRE_FLD_TWO , MLNG.LM_PER_TRN_NM , MLNG.LM_PER_TRN_DESCR , MLNG.LM_PER_TRN_LOC , MLNG.LM_PER_TRN_INST , MLNG.LM_EU_TYPE FROM PS_LM_ADHC_TBL S , PS_LM_ADHC_LNG_TBL SLNG , PS_LM_ADHC_LRN_TBL M , PS_LM_AD_LRNEU_LVW MLNG , PS_LM_PERSON P WHERE S.LM_ADHC_ID = M.LM_ADHC_ID AND S.LM_ADHC_ID = SLNG.LM_ADHC_ID AND S.EFFDT = SLNG.EFFDT AND SLNG.LANGUAGE_CD = MLNG.LANGUAGE_CD AND M.LM_ADHC_LRN_ID = MLNG.LM_ADHC_LRN_ID AND M.LM_PERSON_ID = P.LM_PERSON_ID AND %CurrentDateIn BETWEEN S.EFFDT AND S.LM_END_EFFDT AND EXISTS ( SELECT 1 FROM PS_LM_ADH_APR_XREF X WHERE X.LM_ADHC_LRN_ID = M.LM_ADHC_LRN_ID) UNION SELECT M.LM_ADHC_LRN_ID , MLNG.LANGUAGE_CD , S.LM_ADHC_TYPE , MLNG.LM_PRVD_BY , MLNG.LM_SUP_BY , MLNG.LM_FRE_FLD_FOUR , MLNG.LM_FRE_FLD_ONE , MLNG.LM_FRE_FLD_THREE , MLNG.LM_FRE_FLD_TWO , MLNG.LM_PER_TRN_NM , MLNG.LM_PER_TRN_DESCR , MLNG.LM_PER_TRN_LOC , MLNG.LM_PER_TRN_INST , MLNG.LM_EU_TYPE FROM PS_LM_ADHC_TBL S , PS_LM_ADHC_LRN_TBL M , PS_LM_AD_LRNEU_LVW MLNG , PS_LM_PERSON P WHERE S.LM_ADHC_ID = M.LM_ADHC_ID AND M.LM_ADHC_LRN_ID = MLNG.LM_ADHC_LRN_ID AND M.LM_PERSON_ID = P.LM_PERSON_ID AND %CurrentDateIn BETWEEN S.EFFDT AND S.LM_END_EFFDT AND EXISTS ( SELECT 1 FROM PS_LM_ADH_APR_XREF X WHERE X.LM_ADHC_LRN_ID = M.LM_ADHC_LRN_ID) AND NOT EXISTS ( SELECT 1 FROM PS_LM_ADHC_LNG_TBL SLNG WHERE S.LM_ADHC_ID = SLNG.LM_ADHC_ID AND S.EFFDT = SLNG.EFFDT AND SLNG.LANGUAGE_CD = MLNG.LANGUAGE_CD ) UNION SELECT M.LM_ADHC_LRN_ID , SLNG.LANGUAGE_CD , SLNG.LM_ADHC_TYPE , M.LM_PRVD_BY , M.LM_SUP_BY , M.LM_FRE_FLD_FOUR , M.LM_FRE_FLD_ONE , M.LM_FRE_FLD_THREE , M.LM_FRE_FLD_TWO , M.LM_PER_TRN_NM , M.LM_PER_TRN_DESCR , M.LM_PER_TRN_LOC , M.LM_PER_TRN_INST , E.LM_EU_TYPE FROM PS_LM_ADHC_TBL S , PS_LM_ADHC_LNG_TBL SLNG , PS_LM_ADHC_LRN_TBL M LEFT OUTER JOIN PS_LM_EU_TBL E ON M.LM_EU_ID = E.LM_EU_ID , PS_LM_PERSON P WHERE S.LM_ADHC_ID = M.LM_ADHC_ID AND S.LM_ADHC_ID = SLNG.LM_ADHC_ID AND S.EFFDT = SLNG.EFFDT AND M.LM_PERSON_ID = P.LM_PERSON_ID AND %CurrentDateIn BETWEEN S.EFFDT AND S.LM_END_EFFDT AND EXISTS ( SELECT 1 FROM PS_LM_ADH_APR_XREF X WHERE X.LM_ADHC_LRN_ID = M.LM_ADHC_LRN_ID) AND NOT EXISTS ( SELECT 1 FROM PS_LM_AD_LRNEU_LVW MLNG WHERE M.LM_ADHC_LRN_ID = MLNG.LM_ADHC_LRN_ID AND SLNG.LANGUAGE_CD = MLNG.LANGUAGE_CD )
|