1、oracle
select * from (select t.*, rownum rn from (select * from t1 order by t1.cid desc) t where rownum < 100000) where rn > 99900;
t1为表名 cid为表的关键字段
2、MySQL
select * from t1 limit 10,20
t1为表名 ,limit函数
3、SQL server
top
本文介绍了在Oracle、MySQL和SQL Server中实现高效分页查询的方法。对于Oracle, 使用ROWNUM结合子查询;MySQL则利用LIMIT函数;而SQL Server通过TOP语法实现。这些技巧有助于提升大型数据集的查询效率。
1、oracle
select * from (select t.*, rownum rn from (select * from t1 order by t1.cid desc) t where rownum < 100000) where rn > 99900;
t1为表名 cid为表的关键字段
2、MySQL
select * from t1 limit 10,20
t1为表名 ,limit函数
3、SQL server
top
2278

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