How to return result set with incremented rows? [duplicate]
Possible Duplicate:
SQL Server ROW_NUMBER() on SQL Server 2000?
How do I return a row and an ascending counter as a result set?
The function Row_number() is not known in MS SQL 2000.
Create a variable table with an identity column and insert the results into it:
DECLARE TABLE @MYTABLE
(
ID INT IDENTITY,
VALUES......
)
INSERT INTO @MYTABLE
SELECT MYVALUES.....
SELECT * FROM @MYTABLE
精彩评论