SELECT C.LM_ACT_ID , A.LM_LRNR_GROUP_ID , A.LM_LRNR_GRP_DESCR , A.LM_LRNR_GRP_SDESCR FROM PS_LM_LRNR_GROUPS A , PS_LM_ACT_SEC C WHERE A.LM_LRNR_GROUP_ID = C.LM_LRNR_GROUP_ID AND A.LM_LG_TYPE <> 'X' AND A.LM_ACTIVE = 'Y' UNION SELECT DISTINCT H.LM_ACT_ID , F.LM_LRNR_GROUP_ID , F.LM_LRNR_GRP_DESCR , F.LM_LRNR_GRP_SDESCR FROM PS_LM_LRNR_GROUPS F , PS_LM_ACT_SEC H WHERE F.LM_ACTIVE = 'Y' AND %NumToChar(F.LM_LRNR_GROUP_ID) IN ( SELECT DISTINCT E.LM_CRITERIA_VALUE FROM PS_LM_LRNR_GROUPS A , PS_LM_ACT_SEC C , PS_LM_GROUPS_CRIT E WHERE A.LM_LRNR_GROUP_ID = C.LM_LRNR_GROUP_ID AND A.LM_LG_TYPE = 'X' AND A.LM_LRNR_GROUP_ID = E.LM_LRNR_GROUP_ID AND C.LM_ACT_ID = H.LM_ACT_ID)
|