SELECT a.RECNAME , x1.LANGUAGE_CD , x1.RECDESCR FROM PSRECFIELD a , PSRECDEFN x , PSRECDEFNLANG x1 WHERE a.RECNAME = x.RECNAME AND (x.RECTYPE = 0 OR x.RECTYPE = 1) AND x.RECNAME = x1.RECNAME AND a.RECNAME IN ( SELECT a1.RECNAME FROM PSRECFLDKEYSVW a1 GROUP BY a1.RECNAME HAVING COUNT(*) = 1 ) UNION SELECT a.RECNAME , x1.LANGUAGE_CD , x1.RECDESCR FROM PSRECFIELD a , PSRECDEFN x , PSRECDEFNLANG x1 WHERE a.FIELDNAME = 'EFFDT' AND a.FIELDNUM = 2 AND %DecMult(%Round(%DecDiv(a.USEEDIT,2),0 ) , 2) <> a.USEEDIT AND a.RECNAME = x.RECNAME AND (x.RECTYPE = 0 OR x.RECTYPE = 1) AND x.RECNAME = x1.RECNAME AND a.RECNAME IN ( SELECT a1.RECNAME FROM PSRECFLDKEYSVW a1 GROUP BY a1.RECNAME HAVING COUNT(*) = 2) UNION SELECT a.RECNAME , x1.LANGUAGE_CD , x1.RECDESCR FROM PSRECFIELD a , PSRECDEFN x , PSRECDEFNLANG x1 WHERE (a.FIELDNAME = 'INSTITUTION' OR a.FIELDNAME = 'SETID') AND a.FIELDNUM = 1 AND %DecMult(%Round(%DecDiv(a.USEEDIT,2),0 ) , 2) <> a.USEEDIT AND a.RECNAME = x.RECNAME AND (x.RECTYPE = 0 OR x.RECTYPE = 1) AND x.RECNAME = x1.RECNAME AND a.RECNAME IN ( SELECT a1.RECNAME FROM PSRECFLDKEYSVW a1 GROUP BY a1.RECNAME HAVING COUNT(*) = 2) UNION SELECT a.RECNAME , x1.LANGUAGE_CD , x1.RECDESCR FROM PSRECFIELD a , PSRECFIELD c , PSRECDEFN x , PSRECDEFNLANG x1 WHERE a.RECNAME = c.RECNAME AND (a.FIELDNAME = 'INSTITUTION' OR a.FIELDNAME = 'SETID') AND c.FIELDNAME = 'EFFDT' AND a.FIELDNUM = 1 AND c.FIELDNUM = 3 AND %DecMult(%Round(%DecDiv(a.USEEDIT,2),0 ) , 2) <> a.USEEDIT AND %DecMult(%Round(%DecDiv(c.USEEDIT,2),0 ) , 2) <> c.USEEDIT AND a.RECNAME = x.RECNAME AND (x.RECTYPE = 0 OR x.RECTYPE = 1) AND x.RECNAME = x1.RECNAME AND a.RECNAME IN ( SELECT a1.RECNAME FROM PSRECFLDKEYSVW a1 GROUP BY a1.RECNAME HAVING COUNT(*) = 3 )
|