

CREATE VIEW DAQDEALIAS AS 
  SELECT 
   a.*,
   e.dataElement AS adName1,
   e.elementAlias AS adName2,
   e.asBitData,
   e.genericPicture,
   e.isComplex,
   e.isSigned,
   e.isLOB,
   e.numericPrecision,
   e.scale,
   e.stringLength,
   e.stringVaryingCode,
   e.typeCode,
   e.vagSignFormat,
   e.elementDescription,
   e.elementDescType
  FROM
    DAQDEALIASBase a
    INNER JOIN DSDatElmntAls_vrsn b ON b.OID=a.OID AND b.OVer=a.OVer
    LEFT OUTER JOIN adobjectFind c ON c.OID=b.pDataElement AND
       c.className='DSLinkDEAlias2DataElmn' AND
       c.contextRelease=a.contextRelease AND c.contextName=a.contextName
    LEFT OUTER JOIN ADLink d ON d.OID=c.OID AND d.OVer=c.OVer
    LEFT OUTER JOIN DAQDATAELEMENT e ON e.OID=d.adTarget AND e.OVer=d.OVer    
AND  e.contextRelease=a.contextRelease AND  e.contextName=a.contextName;