您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

SqlServer分页查询

bubuko 2022/1/25 19:03:19 sqlserver 字数 2594 阅读 929 来源 http://www.bubuko.com/infolist-5-1.html

例如要从数据库的第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 ...

例如要从数据库的第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


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶