I have an SQLite database that I need to do the following: Keep only last N records, sorted by date. How do you do that?
I have an SQLite database that I need to do the following: Keep only last N records, sorted by date. How do you do that?
I wonder if this is faster or slower than Jackob solution. sqlitebrowser says 0ms for both...
DELETE FROM test WHERE date < ( SELECT date FROM test ORDER BY date DESC LIMIT 1 OFFSET 9 )