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, ....
精彩评论