为什么这个查询没有在android SQLite中返回任何内容

时间:2016-02-15 21:34:12

标签: android sqlite

SELECT * FROM EVENT_total_time 
WHERE USER_ID = 2 
    AND LEVEL_SEQUENCE_NUMBER = 1 
    AND DATETIME( TIMESTAMP ) BETWEEN DATETIME('now','-7 days') AND DATETIME('now') 
ORDER BY datetime( TIMESTAMP ) ASC

并且数据库有

PRINTING TABLE EVENT_total_time
0 {
    _id=56
    USER_ID=2
    TIMESTAMP=2016-02-15 21:29:29
    EPOCH_TIME=1455571769621
    NEW_VALUE=3.034
    LEVEL_ID=7
    LEVEL_SEQUENCE_NUMBER=1
    EXTRAS={"old_value":0}
  }
1 {
    _id=57
    USER_ID=2
    TIMESTAMP=2016-02-15 21:29:29
    EPOCH_TIME=1455571769822
    NEW_VALUE=3.219
    LEVEL_ID=7
    LEVEL_SEQUENCE_NUMBER=1
    EXTRAS={"old_value":3.034}
  }

此查询是在30秒前运行的所以... datetime(' now')应该是15.02.2016 21:32:00 ....

我运行了这个查询,它产生了一个空结果。有人能发现原因吗?

0 个答案:

没有答案