查询列表后生成序号列的SQL语句

来源:互联网 发布:店淘软件 编辑:程序博客网 时间:2024/03/29 14:34

            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)就是用于自动生成序号的

0 0
原创粉丝点击