zoukankan      html  css  js  c++  java
  • mysql中varchar类型和datetime类型字段进行比较

    我是在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;
  • 相关阅读:
    01
    商城管理系统
    10
    09
    08
    07(3)
    07(2)
    07
    06
    jsp第一次作业
  • 原文地址:https://www.cnblogs.com/init-007/p/12668649.html
Copyright © 2011-2022 走看看