This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery

DELETE FROM tmp_debug WHERE Id NOT IN (SELECT Id FROM tmp_debug ORDER BY Id DESC LIMIT 2)
-- DELETE FROM tmp_debug WHERE Id NOT IN (SELECT * FROM ((SELECT Id FROM tmp_debug ORDER BY Id DESC LIMIT 2)) AS t)

 

posted @ 2021-06-02 13:52  papering  阅读(121)  评论(0编辑  收藏  举报