select * from tablename where (id not in (select top 40 id from tablename order by id)) and id in (select top 50 id from tablename order by id) 这样就能实现前41-50条数据
实现前41-50条数据
最新推荐文章于 2025-04-10 08:00:00 发布
博客介绍了使用SQL语句获取指定表中前41 - 50条数据的方法,通过嵌套子查询,利用`not in`和`in`结合`top`关键字实现数据筛选,语句为`select * from tablename where (id not in (select top 40 id from tablename order by id)) and id in (select top 50 id from tablename order by id)`。
select * from tablename where (id not in (select top 40 id from tablename order by id)) and id in (select top 50 id from tablename order by id) 这样就能实现前41-50条数据
1583

被折叠的 条评论
为什么被折叠?



