Reputation: 9121
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.
Upvotes: 0
Views: 833
Reputation: 180050
For timestamps, a > b
means that a
is later/newer than b
.
"Older" is the opposite.
You want a comparison like time < date('now')
.
Upvotes: 1