码迷,mamicode.com
首页 > 数据库 > 详细

oracle去重

时间:2015-11-19 09:36:17      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:

oracle去重

create table tmp_table3
as
 (SELECT seqno
                   FROM (SELECT t.seqno,ROWID,
                                ROW_NUMBER() OVER(PARTITION BY title, uin ORDER BY createtime) DUP
                           FROM calendar_info t
                          where isdelflag = 0
                            and specialtype = 1
                            --and uin = ‘30647‘
                            and comefrom = 12)
                  WHERE DUP > 1);
--删除邀请表
delete calendar_invite_info
 where calseqno in (select seqno from tmp_table3);
--更新变更表
update CALENDAR_SYNC_UPDATE
   set token       = calendar_sync_update_token.nextVal,
       action_type = 2,
       updateTime  = sysdate
 WHERE calseqno IN (select seqno from tmp_table3);
--删除活动表
delete calendar_info
 where seqno in (select seqno from tmp_table3);

 

oracle去重

标签:

原文地址:http://www.cnblogs.com/wanghongye/p/4976548.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!