a:没有主键的情形:
   Select identity(int,1,1) as iid,* into #tmp from TableName
   Select * from #tmp
   Drop table #tmp
  b:有主键的情形:
   Select (Select sum(1) from TableName where KeyField <= a.KeyField) as iid,* from TableName a order by iid

相关文章:

  • 2022-12-23
  • 2021-08-17
  • 2021-12-16
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
猜你喜欢
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-03-04
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案