1、定期执行:
DELETE FROM table where _id NOT IN (SELECT _id from table ORDER BY insertion_date DESC LIMIT 50)
2、或者建立一个trigger:
CREATE TRIGGER delete_till_50 INSERT ON _table WHEN (select count(*) from _table)>50 BEGIN DELETE FROM _table WHERE _table._id IN (SELECT _table._id ORDER BY _table._id limit (select count(*) -50 from _table )); END;