mysql中只保存name字段的最新的100条数据,100条之前的数据删除,该怎么做?

2024-11-16 01:08:13
推荐回答(1个)
回答1:

delete A
from A left join
(select id,name,time from A order by time desc limit 100) t1
on A.id=t1.id
where t1.id is null