Oracle SQLServer2000 MySQL 分页

Oracle 分页:
Select * From (Select A.*, Rownum RN From (Select * From xt_inform Where status = '1' Order By top Desc, issuedate Desc ) A Where Rownum <=10) Where RN > 0
SQLServer 分页:
select top 10* from tb_dangan order by id desc // 第一页使用的语句
select top 10 * from tb_dangan where id not in(select top 20 id from tb_dangan order by id desc) order by id desc // 除了第一页使用的分页语句 10:每页显示多少条记录 20:(当前页-1)*每页显示记录数
MySQL 分页:
int startPos = (pageNo - 1) * PAGE_SIZE;
select * from article where pid = 0 order by pdate desc limit " + startPos + "," + PAGE_SIZE

 

你可能感兴趣的:(oracle,mysql,数据库,分页,休闲)