任务描述

1、清除一个UPC对应多分类的数据  2.5工时


清理SQL如下:

# -- 清除UPC相同但分类不同的记录 -------- 开始  --------------------
#1.找出UPC相同的记录
insert into tb_allegroupc_tmp (SKu)
select Upc from m_market_allegro_upc
GROUP BY upc
HAVING COUNT(1)>1;    
    
create table m_market_allegro_upc_0920 like m_market_allegro_upc;
    
insert into m_market_allegro_upc_0920 (Id,Sku,Upc,CategoryId)
select * from m_market_allegro_upc where upc in (
select sku from tb_allegroupc_tmp
);

#2、在1步骤中找到UPC相同且有不同分类的UPC

TRUNCATE TABLE tb_allegroupc_tmp;  -- 清空临时表

insert into tb_allegroupc_tmp (SKu)
select tt.upc from (
select upc, Max(CategoryId) maxcateid, Min(CategoryId) as mincateid  from m_market_allegro_upc_0920
GROUP BY upc
) as tt where tt.maxcateid<>tt.mincateid
    
    
create table m_market_allegro_upc_0920_02 like m_market_allegro_upc;
    
insert into m_market_allegro_upc_0920_02 (Id,Sku,Upc,CategoryId)
select Id,Sku,Upc,CategoryId from m_market_allegro_upc_0920 where upc in (
select sku from tb_allegroupc_tmp
);

                    

#3.删除UPC相同但分类不同的记录
TRUNCATE TABLE bigid_temp3;
INSERT INTO bigid_temp3 (Id)
select id from m_market_allegro_upc_0920_02 limit 100000;
delete from m_market_allegro_upc_0920_02 where id in (select ID from bigid_temp3);
delete from m_market_allegro_upc where id in (select ID from bigid_temp3);

历史记录  
  1. 2023-09-20 18:38:32, 由 韦思成 创建。
  2. 2023-09-20 18:38:52, 由 韦思成 完成。
    修改了 总计消耗,旧值为 "0",新值为 "2.5"。
    修改了 指派给 ,旧值为 "weisicheng",新值为 "chengwei"。
    修改了 实际完成,旧值为 "",新值为 "2023-09-20 18:38:40"。
    修改了 任务状态,旧值为 "wait",新值为 "done"。
    修改了 实际开始,旧值为 "0000-00-00 00:00:00",新值为 "2023-09-20 18:38:52"。
    修改了 预计剩余,旧值为 "2.5",新值为 "0"。
    修改了 由谁完成,旧值为 "",新值为 "weisicheng"。
    已完成
  3. 2023-09-21 21:10:04, 由 程伟 关闭。
    修改了 任务状态,旧值为 "done",新值为 "closed"。
    修改了 指派给 ,旧值为 "chengwei",新值为 "closed"。
    修改了 由谁关闭,旧值为 "",新值为 "chengwei"。
    修改了 关闭时间,旧值为 "0000-00-00 00:00:00",新值为 "2023-09-21 21:10:04"。
    修改了 关闭原因,旧值为 "",新值为 "done"。
所属迭代 技术研发中心 9月运维事项(2023年)
所属模块 /
相关需求 暂无
指派给 Closed 于 2023-09-21 21:10:04
任务类型 运维
任务标签 初始
开发组 有品开发组
任务状态 已关闭
进度 100%
优先级 P2
关键词
抄送给
由谁创建 韦思成 于 2023-09-20 18:38:32
由谁完成 韦思成 于 2023-09-20 18:38:40
由谁取消 暂无
由谁关闭 程伟 于 2023-09-21 21:10:04
关闭原因 已完成
最后编辑 程伟 于 2023-09-21 21:10:04
团队 最初预计 总计消耗 预计剩余
工时信息
最初预计 2.5工时
总计消耗 2.5工时
预计剩余 0工时
预计开始 2023-09-20
实际开始 2023-09-20
截止日期 2023-09-20