int maxCount = 500;
//删除多余500个的条数
String deleteSql = "delete from logs where (select count(*) from logs)> " + maxCount + " and id in (select id from logs order by id desc limit (select count(*) from logs) offset " + maxCount + " )";
db.execSQL(deleteSql);
Andorid sql设置最多存储多少条数据
最新推荐文章于 2024-09-09 23:37:05 发布