最近重构项目中,涉及到表结构变更, 需要对原来的数据做代码层面的双向更新,保证数据一致性。发现mysql中有REPLACE 函数

REPLACE INTO coupon_test.w_user_coupon_use_record( id,user_id_code, user_coupon_id, order_sn, coupon_type, order_id, status, rule_config, biz_code, created_time, updated_time, deleted_time) VALUES (29, 2594277, 17191161, '160576703474599524277', 6, 0, 1, '[{"amount":100,"discount":0.0,"level":1,"promotionId":1010335,"step":1},{"amount":100,"discount":0.0,"level":2,"promotionId":1010335,"step":1},{"amount":100,"discount":0.0,"level":3,"promotionId":1010335,"step":1},{"amount":100,"discount":0.0,"level":4,"promotionId":1010335,"step":1},{"amount":100,"discount":0.0,"level":5,"promotionId":1010335,"step":1}]', '', '2020-11-19 14:23:56', '2021-01-23 11:48:59', NULL);

相关文章:

  • 2021-12-08
  • 2022-12-23
  • 2021-07-30
  • 2021-11-18
  • 2021-09-27
  • 2022-12-23
  • 2021-11-21
猜你喜欢
  • 2022-12-23
  • 2021-05-03
  • 2021-04-26
  • 2021-07-24
  • 2022-12-23
  • 2021-09-20
相关资源
相似解决方案