SELECT B.SCC_ENTITY_ID , B.LANGUAGE_CD , B.SCC_ENTITY_NAME , C.SCC_ENT_TYPE_NAME , B.SCC_ENTITY_DESCR FROM PS_SCC_ENTITY_REG A , PS_SCC_ENT_REG_LNG B , PS_SCC_ENT_TYPE_LN C WHERE A.SCC_ENTITY_TYPE_ID = C.SCC_ENTITY_TYPE_ID AND A.SCC_ENTITY_ID = B.SCC_ENTITY_ID AND B.LANGUAGE_CD = C.LANGUAGE_CD UNION /* entity type name has translation but entity name does not*/ SELECT B1.SCC_ENTITY_ID , C1.LANGUAGE_CD , B1.SCC_ENTITY_NAME , C1.SCC_ENT_TYPE_NAME , B1.SCC_ENTITY_DESCR FROM PS_SCC_ENTITY_TYPE A1 , PS_SCC_ENTITY_REG B1 , PS_SCC_ENT_TYPE_LN C1 WHERE A1.SCC_ENTITY_TYPE_ID = C1.SCC_ENTITY_TYPE_ID AND A1.SCC_ENTITY_TYPE_ID = B1.SCC_ENTITY_TYPE_ID AND NOT EXISTS ( SELECT 'X' FROM PS_SCC_ENT_REG_LNG BB1 WHERE B1.SCC_ENTITY_ID = BB1.SCC_ENTITY_ID AND BB1.LANGUAGE_CD = C1.LANGUAGE_CD) UNION /* entity type name has no translation but entity name has translation */ SELECT C2.SCC_ENTITY_ID , C2.LANGUAGE_CD , C2.SCC_ENTITY_NAME , B2.SCC_ENT_TYPE_NAME , C2.SCC_ENTITY_DESCR FROM PS_SCC_ENTITY_REG A2 , PS_SCC_ENTITY_TYPE B2 , PS_SCC_ENT_REG_LNG C2 WHERE A2.SCC_ENTITY_TYPE_ID = B2.SCC_ENTITY_TYPE_ID AND A2.SCC_ENTITY_ID = C2.SCC_ENTITY_ID AND NOT EXISTS ( SELECT 'X' FROM PS_SCC_ENT_TYPE_LN BB2 WHERE B2.SCC_ENTITY_TYPE_ID = BB2.SCC_ENTITY_TYPE_ID AND BB2.LANGUAGE_CD = C2.LANGUAGE_CD)
|