日期:2014-05-19  浏览次数:20475 次

查询当前行的行数
如果有一表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