我有这个问题:
UPDATE answers AS aa SET aa.question_id=(SELECT q.id FROM question AS q WHERE q.question LIKE (SELECT a.question_prev FROM answers AS a))
错误:
mysql无法指定目标表
无法弄清楚如何编辑它才能正常工作
答案 0 :(得分:1)
试试这个,
UPDATE answers a
INNER JOIN question b
ON b.question = a.question_prev
SET a.question_id = b.id
请在执行语句前先备份。