Oracle数据库
因为Oracle数据库没有Top关键字所以这里就不能够像微软的数据据那样操作这里有两种方法
()一种是利用相反的
PAGESIZE每页显示的记录数
CURRENTPAGE当前页号
数据表的名字是components
索引主键字是id
select * from components where id not
in(select id from components where
rownum<=(PAGESIZE*(CURRENTPAGE)))
and rownum<=PAGESIZE order by id;
如下例
select * from components where id not in
(select id from components where rownum<=)
and rownum<= order by id;
从到记录开始选择选择前面条
()使用minus即中文的意思就是减去
select * from components where rownum
<=(PAGESIZE*(CURRENTPAGE)) minus
select * from components where rownum
<=(PAGESIZE*(CURRENTPAGE));
如例select * from components where
rownum<= minus select * from components
where rownum<=;
()一种是利用Oracle的rownum这个是Oracle查询自动返回的序号一般不显示但是可以通过select rownum from [表名]看到注意它是从到当前的记录总数
select * from (select rownum tidcomponents
* from components where rownum<=) where tid<=;
[] []