2 coolpig379 coolpig379 于 2015.06.07 14:49 提问

mysql update操作 出现incorrect datetime value
    update iportal_wx.inviterelationshipcycle as A,
(select * from iportal_wx.register where register_ctime<current_timestamp()
AND register_ctime>ADDDATE(current_timestamp(),-1)) as B
set A.IsAttentionHNLLGJ='Y'
where A.MDN_PY=B.user_phone;

    时间对象的数据类型均为datetime

1个回答

danielinbiti
danielinbiti   Ds   Rxr 2015.06.07 14:59
 update iportal_wx.inviterelationshipcycle as A
set A.IsAttentionHNLLGJ='Y'
where exists(select 1 from iportal_wx.register where register_ctime<current_timestamp()
AND register_ctime>ADDDATE(current_timestamp(),-1) and A.MDN_PY=user_phone);
Csdn user default icon
上传中...
上传图片
插入图片