CREATE VIEW "SBODEMODE"."B1_EDFLatestLogsView" ( "AbsEntry", "LogNum", "LogType", "LogMessage", "LogData", "LogOpDate", "LogOpTS", "ExportFmt", "UserSign", "CreateDate", "CreateTS", "UserSign2", "UpdateDate", "UpdateTS", "LogInstanc", "ExportFile", "AutProcess", "Sensitive", "RankByDT" ) AS SELECT "TBLRANK"."AbsEntry" , "TBLRANK"."LogNum" , "TBLRANK"."LogType" , "TBLRANK"."LogMessage" , "TBLRANK"."LogData" , "TBLRANK"."LogOpDate" , "TBLRANK"."LogOpTS" , "TBLRANK"."ExportFmt" , "TBLRANK"."UserSign" , "TBLRANK"."CreateDate" , "TBLRANK"."CreateTS" , "TBLRANK"."UserSign2" , "TBLRANK"."UpdateDate" , "TBLRANK"."UpdateTS" , "TBLRANK"."LogInstanc" , "TBLRANK"."ExportFile" , "TBLRANK"."AutProcess" , "TBLRANK"."Sensitive" , "TBLRANK"."RankByDT" FROM (SELECT
	 *,
	 CAST(RANK() OVER (PARTITION BY "AbsEntry",
	 "LogType" 
			ORDER BY "LogOpDate" DESC,
	 "LogOpTS" DESC,
	 "LogNum" DESC) AS Integer) AS "RankByDT" 
	FROM "ECM3" ) tblRank 
WHERE tblRank."RankByDT" = 1 ORDER BY "AbsEntry",
	 "LogType" WITH READ ONLY