我有下表:
mentor (mentor_id, name, contact, country)
team (team_id, mentor_id, name, status)
我想更新team.status = 'Approved' where team.mentor_id = mentor.mentor_id AND mentor.country = 'ABC';
但上面的查询无效。请帮帮我谢谢。
答案 0 :(得分:0)
使用join
试试这个: -
update mentor m join
team t
on m.mentor_id = t.mentor_id
set t.status = 'Approved' where m.country = 'ABC'