Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试删除最低的 60 行,但它不起作用。我在stackoverflow中尝试了其他一些帖子,但没有一个对我有用。
DELETE FROM windUpdates WHERE INDEX <= ( ( SELECT MAX( INDEX ) FROM windUpdates ) - 60 )
谢谢。
您需要为子查询的结果创建临时表,
DELETE FROM tablename WHERE `Index` NOT IN ( SELECT `Index` FROM ( SELECT `Index` FROM tablename ORDER BY `Index` DESC LIMIT 60 ) x )
PS:一定要先备份你的数据库。