Home > Database > Mysql Tutorial > body text

ORACLE 分页SQL

WBOY
Release: 2016-06-07 15:21:00
Original
1062 people have browsed it

1、使用rowid、rownum位列分页 select * from table1 where rowid in ( select rid from ( select rid,rownum rn from ( select rowid rid from table1 order by fid desc ) where rownum4 ) where rn=1 ) order by fid; 2、使用rownum伪列进行分页 select *

1、使用rowid、rownum位列分页

select * from table1 where rowid in (select rid from (select rid,rownum rn from (select rowid rid from table1 order by fid desc) where rownum) where rn>=1) order by fid;

2、使用rownum伪列进行分页

select * from (select t1.*,rownum rn from (select * from table1 order by fid) t1 where rownum=1 order by fid

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template