Delete - I can't specify target table?

╄→гoц情女王★ 提交于 2019-11-28 19:10:47

Try in this way

DELETE FROM recent_edits 
WHERE trackid NOT IN 
     (select * from (SELECT DISTINCT history.trackid 
     FROM history JOIN recent_edits ON history.trackid=recent_edits.trackid 
     GROUP BY recent_edits.trackid) as t);

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!