DECLARE @startRowIndex int
set @startRowIndex=0
Declare @maximumRows int
set @maximumRows=5
SET ROWCOUNT 5;
WITH OrderedEmployees As
SELECT *, ROW_NUMBER() OVER (Order By EmployeeID ASC) as RowNum FROM Employees
SELECT * FROM OrderedEmployees Where RowNum > @startRowIndex
Order By EmployeeID ASC
我从一个网站上得到了这个查询,但是当我在 SQL Server Management Studio 中运行它时,它给了我以下错误,请帮帮我,我直觉这只是一个语法错误,让我很困惑,请帮帮我
消息 156,级别 15,状态 1,第 10 行
关键字“SELECT”附近的语法不正确