sqlite 删除前 n 条数据
sqlite 数据库设计超过容量就删除最前面的 n 行数据,用到的 sql 语句如下:
public void deleteTableHead(SQLiteDatabase db,
String table, String column, long num) {
String delete = "delete from " + table + " where " + column +
" in(select " + column + " from " + table + " limit " + num + ")";
db.execSQL(delete);
}
参考:
删除SQLITE数据库前N行或指定行问题
https://www.cnblogs.com/elect-fans/archive/2012/08/04/2622480.html
Sqlite数据库添加,删除前n条记录
https://blog.csdn.net/asdssaaaa/article/details/52229546
安卓 SQLite 数据库删除前 n 条记录
https://blog.csdn.net/fzhhsa/article/details/103032844?spm=1001.2101.3001.6650.8&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-8.pc_relevant_default&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7ECTRLIST%7ERate-8.pc_relevant_default&utm_relevant_index=12
Sqlite之删除超过50条的数据
https://blog.csdn.net/u014213012/article/details/76269768