Reputation:
I have a column timestamp
of data type TEXT
in an SQLite table.
I want to delete everything prior to 2015-03-01 00:00:00
(YYYY-MM-DD HH:MM:SS).
What is the correct way to do so?
Upvotes: 0
Views: 57
Reputation: 20122
delete from tablename where timestamp < '2015-03-01 00:00:00';
The natural order of Strings (Text) is the same as of timestamps if your are using the date-format like above starting with the most significant value (year) on the left.
Upvotes: 1