问题描述
- 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
解决方案
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);
时间: 2024-10-30 07:02:49