开发者

Count columns SQL Server

If I have a table

`fnavn - lname - ... - countColumn

And for each SELECT I use on this table, I want countColumn to 开发者_开发百科go up by one.

Is it possible?


Check out ROW_NUMBER(), e.g.

select *, row_number() over(order by fnavn) as [count]
from MyTable
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜