--查询行号

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

05-07 15:49