简体   繁体   中英

SQLite select rows from today and rows older than today?

How can I select all rows that are older than today?

I've tried:

select * from chatHistory WHERE channelID = '%1' AND time >= date('-1 day') order by date(time) ASC;

But this only seems to return rows that are 1 day old.

For timestamps, a > b means that a is later/newer than b .

"Older" is the opposite. You want a comparison like time < date('now') .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM