我尝试下面的代码不工作我的客人可能在哪里,但不是
update member set member.`status` = 4
where member.idmember = select DISTINCT activitynote.idmemberref where activitynote.checkkey =4
然后我尝试
update member, activitynote set member.`status` = 4
where member.idmember = activitynote.idmemberref
and activitynote.checkkey = 4
这段代码是有效的,但不是我想要的东西请帮助
member.idmember是主键,activitynote.idmemberref可以是重复的
答案 0 :(得分:2)
如果我理解正确,那么它应该解决问题。
update member set member.`status` = 4
where member.idmember IN
(select DISTINCT activitynote.idmemberref from activitynote where activitynote.checkkey =4)