I have a table MRU, that has 3 columns.
(VALUE varchar(255); TYPE varchar(20); DT_ADD datetime)
This is a table simply storing an entry and recording the date time it was recorded. What I wanted to do is: delete the oldest entry whenever I add a new entry that exceeds a certain number.
Here is my query:
delete from MRU
where type = 'FILENAME'
ORDER BY DT_ADD limit 1;
The error message is:
SQL Error: near “ORDER”: syntax error …
The query returns an error.
I’m not saying that you should do so, since it’s completely non-portable, but if there’s a compelling need, this will work:
In SQLite the rowid column always exists unless an integer primary key is defined elsewhere. This can be used in something like: