这是我尝试过的:
UPDATE tbl_questions
JOIN (SELECT tbl_users.uid, tbl_users.is_spam
FROM tbl_users JOIN tbl_questions ON tbl_users.uid = tbl_questions.uid
)
SET question_type_id = 2
WHERE is_spam = 2;
我想将这些问题 question_type_id 更新为 2,其中用户表 is_spam = 2。我的 sql 写为错误Every derived table must have its own alias
...
tbl_questions => uid, question_type_id,
tbl_users => uid, is_spam,