我有一个关于Microsoft SQL Server 2005的问题.如何从具有特定行号的表中删除或选择行?
编辑:修改代码,使其更符合OP的意图
Declare @RowNum as INT SET @RowNum = 15 ---Just for example WITH OrdersRN AS ( SELECT ROW_NUMBER() OVER(ORDER BY OrderDate, OrderID) AS RowNum ,OrderID ,OrderDate ,CustomerID ,EmployeeID FROM dbo.Orders ) SELECT * FROM OrdersRN WHERE RowNum = @RowNum ORDER BY OrderDate ,OrderID;