使用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);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章