DELETE tb FROM account AS tb ,(SELECT id FROM account ORDER BY id desc LIMIT 99,1) AS tmp
WHERE tb.id<tmp.id;
select * from account;
保留最后添加的100条数据。
select--语法:
SELECT * FROM table LIMIT [offset,] rows | rows OFFSET offset
--举例:
select * from table limit 5; --返回前5行
select * from table limit 0,5; --同上,返回前5行
select * from table limit 5,10; --返回6-15行