割接2(2)

--对表us_publiccomment进行数据割接
truncate table df_tmp_forrowid;
insert into df_tmp_forrowid
  (select row_id
     from (select t.rowid row_id,
                  row_number() over(partition by t.msisdn,t.contentid , t.commentary order by t.rowid) rn
             from us_publiccomment t)
    where rn > 1);
commit;

begin
pro_del_samecomment('delete from us_publiccomment');
end;
/

--对表us_bookcomment_audit进行数据割接
truncate table df_tmp_forrowid;
insert into df_tmp_forrowid
  (select row_id
     from (select t.rowid row_id,
                  row_number() over(partition by t.msisdn,t.contentid , t.commentary order by t.rowid) rn
             from us_bookcomment_audit t)
    where rn > 1);
commit;

begin
pro_del_samecomment('delete from us_bookcomment_audit');
end;
/

--对表us_bookcomment_publish进行数据割接
truncate table df_tmp_forrowid;
insert into df_tmp_forrowid
  (select row_id
     from (select t.rowid row_id,
                  row_number() over(partition by t.msisdn,t.contentid , t.commentary order by t.rowid) rn
             from us_bookcomment_publish t)
    where rn > 1);
commit;

begin
pro_del_samecomment('delete from us_bookcomment_publish');
end;
/

--对表us_usercomment进行数据割接
truncate table df_tmp_forrowid;
insert into df_tmp_forrowid
  (select row_id
     from (select t.rowid row_id,
                  row_number() over(partition by t.msisdn,t.content order by t.rowid) rn
             from us_usercomment t)
    where rn > 1);
commit;

begin
pro_del_samecomment('delete from us_usercomment');
end;
/

--对表us_topic进行数据割接
truncate table df_tmp_forrowid;
insert into df_tmp_forrowid
  (select row_id
     from (select t.rowid row_id,
                  row_number() over(partition by t.creator,t.content , t.catalogid order by t.rowid) rn
             from us_topic t)
    where rn > 1);
commit;

begin
pro_del_samecomment('delete from us_topic');
end;
/

--对表us_leaveword进行数据割接
truncate table df_tmp_forrowid;
insert into df_tmp_forrowid
  (select row_id
     from (select t.rowid row_id,
                  row_number() over(partition by t.srcmdn,t.leaveword , t.contentid order by t.rowid) rn
             from us_leaveword t)
    where rn > 1);
commit;

begin
pro_del_samecomment('delete from us_leaveword');
end;
/

你可能感兴趣的:(割接2(2))