使用sql从旧表灌数据

  

INSERT INTO t_price_insignt_profit (city_id, f_area,class1_id,class2_id,class3_id,sku_id,ssu_id,cost_price,price_type,price,profit_scope,is_online,is_shelf,channel_id,c_t,u_t)
SELECT f_city,f_area,class1_id,class2_id,class3_id,f_sku,f_ssu, weighted_cost/100000,1,sale_price/100000,gross_profit/100000,is_online,is_shelf, 2,1568884354,1568884354 FROM t_price_monitor_base;
UPDATE t_price_insignt_profit SET cost_price=-1 WHERE cost_price=-0.000010000;

UPDATE t_price_insignt_profit INNER JOIN t_sale_area ON t_price_insignt_profit.f_area=t_sale_area.id AND t_price_insignt_profit.city_id=t_sale_area.city_id SET t_price_insignt_profit.f_area_type=t_sale_area.type ,t_price_insignt_profit.f_warehouse=t_sale_area.warehouse_id WHERE  t_sale_area.type in(1,4);

 

posted @ 2019-12-24 11:25  stevenlii  阅读(291)  评论(0编辑  收藏  举报