我是在mysql5.7版本进行比较

表a的字段order_no和表iwebshop_tmp的字段order_no一样

需要更新iwebshop_member_order表的datetime类型expiration_time,和表b的varchar类型deadline值一样;

update iwebshop_member_order as a join iwebshop_tmp as b on a.order_no = b.order_no set a.expiration_time = b.deadline where a.expiration_time = 0;

以上是报错

 

以下正常:

update iwebshop_member_order as a join iwebshop_tmp as b on a.order_no = b.order_no set a.expiration_time = str_to_date(b.deadline,'%Y-%m-%d %H:%i:%s') where a.expiration_time = 0;

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
  • 2021-07-09
  • 2022-02-02
猜你喜欢
  • 2021-05-27
  • 2022-02-09
  • 2022-01-06
  • 2021-10-27
  • 2021-11-21
  • 2021-10-09
  • 2022-12-23
相关资源
相似解决方案