开发者

Sqlite SELECT * for Last 7 days

Im trying to do a SELECT * to retrieve rows for l开发者_StackOverflow社区ast 7 days in SQLite.

the table structure is as follows

CREATE TABLE 'session' ('rowID' INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL , 'steps' INTEGER, 'stop_time' DATETIME NOT NULL  DEFAULT CURRENT_TIMESTAMP)

How do I do this? Im new at this


SELECT * FROM session WHERE stop_time > (SELECT DATETIME('now', '-7 day'))

Refer to the documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜