常用SQL语句

update

(

select /*+BYPASS_UJVC*/ e.num,f.cnum

from

(  select num,website_id,areaid,stat_time from adt_click_hour_website

   where stat_time<to_date(to_char(sysdate-1/24,'yyyy-MM-dd HH24:') || '00:00','yyyy-mm-dd HH24:MI:ss')

   and stat_time>=to_date(to_char(sysdate-2/24,'yyyy-MM-dd HH24:') || '00:00','yyyy-mm-dd HH24:MI:ss') 

)e,

(

   select areaid,website_id,stat_time,cnum from hour_website_pv 

   where stat_time<to_date(to_char(sysdate-1/24,'yyyy-MM-dd HH24:') || '00:00','yyyy-mm-dd HH24:MI:ss')

   and stat_time>=to_date(to_char(sysdate-2/24,'yyyy-MM-dd HH24:') || '00:00','yyyy-mm-dd HH24:MI:ss')

)

f

where e.stat_time=f.stat_time and e.website_id=f.website_id and e.areaid=f.areaid

) g

set g.cnum=g.num;

commit;

and s.last_call_date<sysdate-7

select Segment_Name,Sum(bytes)/1024/1024||' MB' ,tablespace_name
From User_Extents Group By Segment_Name,tablespace_name order by Sum(bytes)/1024/1024 desc

group by to_char(t.add_time, 'yyyy-mm-dd HH24')
order by to_char(t.add_time, 'yyyy-mm-dd HH24')
to_char(stat_time,'yyyy-mm-dd HH24')='2008-03-28 08'
to_date('2008-03-21 11:05:05','yyyy-mm-dd-hh24:mi:ss')

ANALYZE TABLE hour_adv_url ESTIMATE STATISTICS SAMPLE 10 PERCENT;

purge recyclebin;
                                                              
substr(web_type, 0, 3) = a.website_type_id
to_char(stat_time, 'YYYY-MM-DD')
to_char( wpp.pay_time,'yyyy-mm-dd')='2008-04-28'

select wpp.owner_id from v_web_owner wpp
having count(*)>1 group by wpp.owner_id

truncate table log_web_webid

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值