sqlserver新加一自增长的列,并且更新为行号

--查询行号

select row_number()over(order by CHECKTIME )as RowNum,*from CHECKINOUT

--更新id列为行号

update CHECKINOUT set id=t.rowId from
(select CHECKTIME, ROW_NUMBER() over(Order by CHECKTIME) as rowId from CHECKINOUT ) as t
where t.CHECKTIME = CHECKINOUT.CHECKTIME

上一篇:webstorm 格式化代码及常用快捷键 Option+Command+l


下一篇:Cordova了解