前提:有一张大表,做了表分区,要统计数据,按分区查的。
ok,执行其他分区都OK,很快就出来结果了,但是有一个分区就是查询不出数据,直到断开连接。
有没有大神遇到过这种问题
sql: select count(1) from
(select p.opdate, p.area,p.servid,p.casid from boss_productstr partition(ORGIN_1) p
where p.recid in (
select recid from (
select p.recid, row_number() over(partition by p.servid order by p.recid desc) rn
from boss_productstr partition(ORGIN_1) p
where p.operatorno = 'GZCYNAF001'
and substr(opdate, 1,8)<to_char(to_date('20130111','yyyymmdd'),'yyyymmdd')
) where rn = 1
)and p.bus_code='PO' ) cc left join
(
select max(opdate) opdate,servid from boss_productstr partition(ORGIN_1) where bus_code='PE' and substr(opdate, 1,8)<to_char(to_date('20130111','yyyymmdd'),'yyyymmdd') group by servid ) dd on cc.servid=dd.servid ;
表分区,SQL
ok,执行其他分区都OK,很快就出来结果了,但是有一个分区就是查询不出数据,直到断开连接。
有没有大神遇到过这种问题
sql: select count(1) from
(select p.opdate, p.area,p.servid,p.casid from boss_productstr partition(ORGIN_1) p
where p.recid in (
select recid from (
select p.recid, row_number() over(partition by p.servid order by p.recid desc) rn
from boss_productstr partition(ORGIN_1) p
where p.operatorno = 'GZCYNAF001'
and substr(opdate, 1,8)<to_char(to_date('20130111','yyyymmdd'),'yyyymmdd')
) where rn = 1
)and p.bus_code='PO' ) cc left join
(
select max(opdate) opdate,servid from boss_productstr partition(ORGIN_1) where bus_code='PE' and substr(opdate, 1,8)<to_char(to_date('20130111','yyyymmdd'),'yyyymmdd') group by servid ) dd on cc.servid=dd.servid ;
表分区,SQL
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货