cmdText.AppendFormat("select PK_ID,RANK() OVER (ORDER BY pk_id asc) as SortId,OriginalComponent,ReplaceComponent,MaintainContent,MaintainMan,dbo.f_FormatDate(MaintainDate) as MaintainDate,Remark from FX_ST_T_RemindMaintainLog where 1=1");
注意:RANK() OVER (ORDER BY pk_id asc)就是用于自动生成序号的