zoukankan      html  css  js  c++  java
  • oracle去重

    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);
  • 相关阅读:
    第三天-基本数据类型 int bool str
    第二天-while循环 格式化输出 运算符 编码
    第一天-python基础
    Mysql
    Mysql
    Mysql
    Mysql
    Mysql
    Mysql
    Php
  • 原文地址:https://www.cnblogs.com/wanghongye/p/4976548.html
Copyright © 2011-2022 走看看