解决方案:
虽然SQL Server不支持 Limit ,但是它支持 TOP
如果要查询上述结果中前6条记录,则相应的SQL语句是
select top 6 id from tablename
如果要查询上述结果中第 7 条到第 9 条记录,则相应的SQL语句是:
select top 3 id from tablename
where id not in (
select top 6 id from tablename
)
以此类推:
select top (n-m+1) id from tablename
where id not in (
select top m-1 id from tablename
)
温馨提示:答案为网友推荐,仅供参考