Delete - I can't specify target table?

后端 未结 2 753
刺人心
刺人心 2020-12-13 13:09

Why this query doesn\'t work?

DELETE FROM recent_edits 
WHERE trackid NOT IN 
     (SELECT DISTINCT history.trackid 
     FROM history JOIN recent_edits ON h         


        
2条回答
  •  借酒劲吻你
    2020-12-13 13:25

    You can't post-process a table which is locked for deletion. using the hack select * from (query) as Nicola states will generate a temporary table instead of direct access.

    Edit - make sure that you give ID to the tables you use since it is nested and will require uniqueID for every table.

提交回复
热议问题