CREATE VIEW "SBODEMODE"."SRI1" ( "ItemCode", "SysSerial", "LineNum", "BaseType", "BaseEntry", "BaseNum", "BaseLinNum", "DocDate", "WhsCode", "CardCode", "CardName", "Direction", "CreateDate", "ItemName", "DataSource", "UserSign", "BsDocType", "BsDocEntry", "BsDocLine" ) AS SELECT "ItemCode","SysSerial",(select count(1) from "SBODEMODE".SRI1_LINK b where b."ItemCode" = a."ItemCode" and b."SysSerial" = a."SysSerial" and b."LogEntry" < a."LogEntry" ) as "LineNum","BaseType","BaseEntry","BaseNum","BaseLinNum","DocDate","WhsCode","CardCode","CardName","Direction","CreateDate","ItemName","DataSource","UserSign","BsDocType","BsDocEntry", "BsDocLine" from "SBODEMODE".SRI1_LINK a WITH READ ONLY