开发者

Returning a result with incremented rows in MS SQL Server 2008

开发者 https://www.devze.com 2023-03-07 06:35 出处:网络
How do I return a row and an ascendi开发者_如何学JAVAng counter as a result set?It depends on your RDMS, but there\'s probably a RANK or ROW_NUMBER function.If its SQL Server you can do it with the fo

How do I return a row and an ascendi开发者_如何学JAVAng counter as a result set?


It depends on your RDMS, but there's probably a RANK or ROW_NUMBER function.


If its SQL Server you can do it with the following syntax:

SELECT     ROW_NUMBER() OVER (ORDER BY COLUMN_NAME) AS Id, column1, column2, ....
0

精彩评论

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