分页存储过程的一个小问题
select top 10 *
from msgbox
where msgbox.id <(select min(msgbox.id) from (select top 10 msgbox.id from msgbox order by msgbox.id desc))
order by msgbox.id desc
为什么总是提示:Incorrect syntax near ') '.
我单独运行
select min(msgbox.id) from (select top 10 msgbox.id from msgbox)
也是提示:Incorrect syntax near ') '.
请指点,谢谢
------解决方案--------------------select top 10 *
from msgbox
where msgbox.id <(select min(msgbox.id) from (select top 10 msgbox.id from msgbox order by msgbox.id desc)a)
order by msgbox.id desc
少了临时表名