oracle分页具体事例,Oracle 分页查询的一个实例

1.分页模板

select * from ( select rownum as rn , a.* from( 某个表名) a) where rn between 0 and 6

2 某个表名

select aa.title,aa.url,bb.times, bb.makedate from menu aa,

(select count(*) times,title , max(id) id,max(makedate) makedate from menulog group by title order by count(*) desc ) bb where aa.id=bb.id

3 将2 放入到1 中

select * from ( select rownum as rn , a.* from( select aa.title,aa.url,bb.times, bb.makedate from menu aa,

(select count(*) times,title , max(id) id,max(makedate) makedate from menulog group by title order by count(*) desc ) bb where aa.id=bb.id) a) where rn between 0 and 6

②另外一个实例

select aa.title,aa.url,bb.times, bb.makedate,cc.title from menu aa,menu cc, (select count(*) times,title , max(id) id,max(makedate) makedate from menulog group by title order by count(*) desc ) bb where aa.id=bb.id and aa.pid =cc.id and aa.title like '%医疗账单录入清单%'

198878770_1_20200810065807412

select aa.title, aa.url, bb.times, bb.makedate, cc.title

from menu aa,

menu cc,

(select count(*) times, title, max(id) id, max(makedate) makedate

from menulog

group by title

order by count(*) desc) bb

where aa.id = bb.id

and aa.pid = cc.id

and aa.title like '%医疗账单录入清单%'

198878770_1_20200810065807412

198878770_2_20200810065807537

198878770_1_20200810065807412

select *

from (select rownum as rn, a.*

from (select aa.title,

aa.url,

bb.times,

bb.makedate,

bb.maketime,

(select title from menu kk where kk.id = aa.pid) menulevelfouth

from menu aa,

(select count(*) times,

title,

max(id) id,

max(makedate) makedate,

max(maketime) maketime

from menulog

group by title

order by count(*) desc) bb

where aa.id = bb.id) a)

where rn between 0 and 4

198878770_1_20200810065807412

198878770_3_20200810065807833

select * from ( select rownum as rn , a.* from( select aa.title,aa.url,bb.times, bb.makedate ,cc.title from menu aa,

(select count(*) times,title , max(id) id,max(makedate) makedate from menulog group by title order by count(*) desc ) bb where aa.id=bb.id and aa.pid =cc.id) a) where rn between 0 and 6

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值