Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
select * from allmessages where timestamp > DATETIME('NOW' , '-10 DAY' )
我正在尝试显示在 10 天之前发布的消息,但这是从 1 年开始执行的整个过程。
试试这个:
注意:这仅在您将日期存储在数据库中的时间戳中时才有效。
SELECT * FROM TableName WHERE DATE(column_name) >= DATE('now', '-10 days');
有关更多详细信息,请查看此链接:
http://www.sqlite.org/lang_datefunc.html