我需要为我的联合查询实现分页,但出现错误“Msg 102,Level 15,State 1,Line 14 ''''附近的语法不正确。我跟着我从这个link发现的例子。SQL Server 2008 R2分页
select *
from (select Id,
row_number() OVER (order by Id asc) as RowNumber
from (select Id
from (select Id
from Table1) as table1
union all
select Id
from (select Id
from Table2) as table2)) as t Derived
WHERE RowNumber > 5
and RowNumber <= 10
发生了什么事?你有错误吗? – Axarydax 2011-02-02 06:49:11
已更新的答案包含错误消息。 – newbie 2011-02-02 06:51:21
我从来不喜欢SQL Server的错误位置,但我在代码中计算了12行。你有没有粘贴过什么? – donkim 2011-02-02 06:55:00