当前位置: 代码迷 >> Sql Server >> 查询当前行的行数,该如何处理
  详细解决方案

查询当前行的行数,该如何处理

热度:49   发布时间:2016-04-27 20:54:11.0
查询当前行的行数
如果有一表t1
a       b
5       sf
5       fsd
4       wer
3       wer
想要加一当前行数
a       b             c
5       sf             1
5       fsd           2
4       wer           3
3       wer           4
该怎么写?


------解决方案--------------------
select a,b,c=identity(int,1,1) from tl
------解决方案--------------------
select a,b,c=identity(int,1,1) from tl
  相关解决方案