OFFSET在sql server 2008中的问题 [英] OFFSET in sql server 2008 problem
本文介绍了OFFSET在sql server 2008中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我已在sql server 2008中创建此查询
Hi i have create this query in sql server 2008
select stud_id from student_master
order by stud_id desc
OFFSET (10*10) ROWS FETCH NEXT 200 ROWS ONLY
但是当我运行此查询时,我有这样的错误
消息102,等级15,状态1,行5
'OFFSET'附近的语法不正确。
消息153, 15级,状态2,第5行
FETCH语句中NEXT选项的使用无效。
我的查询中有什么问题请给我一些想法或示例,感谢提前
but when i run this query i have error like this
Msg 102, Level 15, State 1, Line 5
Incorrect syntax near 'OFFSET'.
Msg 153, Level 15, State 2, Line 5
Invalid usage of the option NEXT in the FETCH statement.
what is a problem in my query please give me some idea or example thanks to advance
推荐答案
为什么使用(10 * 10)?
Why you are using (10*10)?
SELECT First Name + ' ' + Last Name FROM Employees ORDER BY First Name OFFSET 10 ROWS FETCH NEXT 5 ROWS ONLY;
尝试这样。
Try like this.
我尝试了SQL Server 2012中的代码并且运行良好。
i tried the code in SQL Server 2012 and it went well.
这篇关于OFFSET在sql server 2008中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文