0

I have this query:

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))

Error:

mysql cant specify target table

And can't figure out how to edit it to work

4

1 回答 1

1

try this,

UPDATE  answers a
        INNER JOIN question b
            ON b.question = a.question_prev
SET     a.question_id = b.id

Please do backup first before executing the statement.

于 2013-05-02T03:35:41.117 回答