数据库修改商品条码

 

根据问题条码修改数据库表的内容.

 仔细看了,才能理解.

-- 修改订单相关各表中的goods_id, A换成B
先互换商品ID UPDATE trade_detail_onl AS tdn SET tdn.goods_id = 5296 WHERE tdn.goods_id = 5164; UPDATE trade_goods_onl AS tgn SET tgn.goods_id = 5296 WHERE tgn.goods_id = 5164; UPDATE refund_detail_onl AS rdn SET rdn.goods_id = 5296 WHERE rdn.goods_id = 5164; UPDATE trade_detail_ofl AS tdf SET tdf.goods_id = 5296 WHERE tdf.goods_id = 5164; -- 更新goods_id对应的条码、名称

根据good_ID, 将华创的商品信息,赋值给有赞的商品信息. UPDATE trade_detail_onl AS tdn, goods AS g SET tdn.goods_barcode = g.barcode, tdn.goods_name = g.`name` WHERE tdn.goods_id = g.id AND g.id = 5293; UPDATE trade_goods_onl AS tgn, goods AS g SET tgn.goods_barcode = g.barcode, tgn.goods_name = g.`name` WHERE tgn.goods_id = g.id AND g.id = 5293; UPDATE refund_detail_onl AS rdn, goods AS g SET rdn.goods_barcode = g.barcode, rdn.goods_name = g.`name` WHERE rdn.goods_id = g.id AND g.id = 5293; UPDATE trade_detail_ofl AS tdf, goods AS g SET tdf.goods_barcode = g.barcode, tdf.goods_name = g.`name` WHERE tdf.goods_id = g.id AND g.id = 5293; -- 根据条码更新华创系统的商品id:goods_id_ofl
更新华创的线上gooods_id_ofl
UPDATE trade_detail_onl AS tdn, arm_changsha.goods_base AS gb SET tdn.goods_id_ofl = gb.id WHERE tdn.goods_barcode = gb.bar_code AND tdn.goods_barcode = "8809348118086"; UPDATE trade_goods_onl AS tgn, arm_changsha.goods_base AS gb SET tgn.goods_id_ofl = gb.id WHERE tgn.goods_barcode = gb.bar_code AND tgn.goods_barcode = "8809348118086"; UPDATE trade_detail_ofl AS tdf, arm_changsha.goods_base AS gb SET tdf.goods_id_ofl = gb.id WHERE tdf.goods_barcode = gb.bar_code AND tdf.goods_barcode = "8809348118086";

 

posted @ 2019-06-13 17:13  Sakura_柏  阅读(452)  评论(0编辑  收藏  举报