USE Northwind
SELECT ROW_NUMBER() OVER (ORDER BY EmployeeID DESC) AS RowID, *
FROM EMPLOYEES ORDER BY FirstName
SELECT ROW_NUMBER() OVER (ORDER BY EmployeeID DESC) AS RowID, *
FROM EMPLOYEES ORDER BY FirstName
Show row number in SQL Server 2000, 2005
http://support.microsoft.com/kb/186133
Oracle:
SELECT rownum, column_name FROM user_tables
Show row number in Oracle
http://blog.lishman.com/2008/03/rownum.html
No comments:
Post a Comment