一、mysql 数据库的分页语句
select *from 表名 where 主键名 limit 当前页数-1,每页显示条数;
例如
select *from user_register where id limit 15,5;
二、 SQL Server 2000/2005数据库的分页语句
SELECT TOP 每页大小 *
FROM 表名
WHERE id NOT IN
(
SELECT TOP 每页大小*(当前页数-1) FROM 表名
)
三、oracle 数据库分页
--分页查询一
select * from (
select a1.*,rownum rn
from (select * from student) a1
where rownum <=5) where rn>=2;
--分页查询二
select a1.* from
(select student.*,rownum rn
from student
where rownum <=5) a1 where rn >=3;
--分页查询三
select a1.* from (
select student.*,rownum rn
from student) a1
where rn between 3 and 5;
时间: 2024-10-01 00:57:00