使用SQLite删除最旧的记录

时间:2012-04-23 15:02:42

标签: html5 sqlite

我想使用SQLite从表中删除最旧的记录,所以我应该使用条件(最低ID)还是有其他补救措施

1 个答案:

答案 0 :(得分:2)

delete from table1 as a where a.id = (select min(id) from table1)

如果您保存了日期,则可以

delete from table1 as a where a.[date]= (select min([date]) from table1)