首页 > 数据库技术 > 详细

SqlServer分页查询

时间:2021-06-15 16:48:48      阅读:26      评论:0      收藏:0      [点我收藏+]

例如要从数据库的第10条数据开始查询5条数据,SqlServer查询语句如下:

select top 5 * from table_name where id not in(
select top 10 id from table_name order by id desc) order by id desc

 

例:

SELECT TOP 5 * FROM MES_MMS_MLOT WHERE MMS_MLOT_SID NOT IN (
select top 10 MMS_MLOT_SID from MES_MMS_MLOT order by MMS_MLOT_SID desc) order by MMS_MLOT_SID desc

 

SqlServer分页查询

原文:https://www.cnblogs.com/kelenote/p/14885399.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!