mysql 分页
select * from t_order limit 5,10
[b]postgresql 分页[/b]
select * from newscontent limit 20 offset 0
sql server 分页
select * from (select top 10 * from (select top (10*6) * from tr_data_userinfo order by available asc) as temptable1 order by available desc) as temptable2 order by available asc
Oracle 分页(rownum)
minus差分页 select * from table where rownum<=10 minus select * from table where rownum<=5
rownum伪列select * from (select rownum tid,t.* from table t where rownum<=10) where tid<=10 and tid>=5
notin相反select * from table where id not in(select id from table where rownum<=5) and rownum<=5
前题是id排序的select * from table where id>(select max(id) from table where rownum<=5) and rownum<=5
select * from t_order limit 5,10
[b]postgresql 分页[/b]
select * from newscontent limit 20 offset 0
sql server 分页
select * from (select top 10 * from (select top (10*6) * from tr_data_userinfo order by available asc) as temptable1 order by available desc) as temptable2 order by available asc
Oracle 分页(rownum)
minus差分页 select * from table where rownum<=10 minus select * from table where rownum<=5
rownum伪列select * from (select rownum tid,t.* from table t where rownum<=10) where tid<=10 and tid>=5
notin相反select * from table where id not in(select id from table where rownum<=5) and rownum<=5
前题是id排序的select * from table where id>(select max(id) from table where rownum<=5) and rownum<=5
本文介绍了多种数据库管理系统中实现分页查询的方法,包括MySQL、PostgreSQL、SQL Server及Oracle等,通过具体的SQL语句示例展示了如何高效地进行数据分页。
7399

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



