oracle、mysql和sqlserver分页
- - Oracle - 数据库 - ITeye博客sql server row number分页:. mysql limit分页:. 已有 0 人发表留言,猛击->> 这里<<-参与讨论. —软件人才免语言低担保 赴美带薪读研.
select b.* FROM ( select row_number() over(order by t.id desc) as rownumber, t.* from table_name t ) as b where b.rownumber <= #endIndex# and b.rownumber >= #beginIndex#
SELECT t.* FROM (SELECT id FROM table_name ORDER BY gmt_create DESC LIMIT #startRow#, #pageSize#) AS a, table_name AS t FORCE INDEX(PRIMARY) WHERE a.id = t.id
select * from ( select t1.* , rownum linenum from ( select t.* from table_name t order by t.GMT_MODIFY desc ) t1 where rownum <= #endIndex#) t2 where t2.linenum >= #beginIndex#