开发者

Sqlite SELECT * for Last 7 days

开发者 https://www.devze.com 2023-01-14 13:32 出处:网络
Im trying to do a SELECT * to retrieve rows for l开发者_StackOverflow社区ast 7 days in SQLite. the table structure is as follows

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

精彩评论

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