开发者

Count columns SQL Server

开发者 https://www.devze.com 2023-04-05 04:33 出处:网络
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.

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

精彩评论

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