-3

I have a Database that has a row that needs to increase by 1 every 24 hours. I enter "19" that first day. Either at midnight or 24 hours Later I would like that value to Change to "20". Is there a way to do that?

Your help would be Appreciated. Thanks

4

2 回答 2

1

您可以创建一个triggerinSQLite或拥有AlarmManagerin JAVA
你可以trigger访问SQLite 触发器
你 可以AlarmManager访问Alarm Manager Example

于 2013-09-17T04:30:07.167 回答
1

SQLite 中没有计算列,在 Android 平台上你不能依赖后台进程。但是您所要做的就是添加一个“创建”日期列以及您的值。每次查询时,将现在和“创建”之间的天差添加到原始列中,以获得您需要的值。

SELECT [myval] + julianday(Date('now')) - julianday([created])) FROM mytable
于 2013-09-17T04:30:14.730 回答