SQLite: How to limit the number of rows based on the timestamp?

后端 未结 1 875
暗喜
暗喜 2021-01-06 12:51

I successfully used the following BEFORE INSERT trigger to limit the number of rows stored in the SQLite database table locations. The database table a

相关标签:
1条回答
  • 2021-01-06 13:17

    This type of trigger should work fine in conjunction with the other one. The problem appears to be that the SQL is unnecessarily quoting the _id field. It is selecting the literal string "_id" for every row and comparing that to the same literal string.

    Removing the quotes around '_id' (both in the DELETE and in the sub-SELECT) should fix the problem.

    0 讨论(0)
提交回复
热议问题