My Android app uses an sqlite table where one of the columns is a timestamp. I need to truncate the table to the X most recent rows. That is, I need to truncate the table to X rows, where all the truncated rows have a timestamp older than the X remaining rows.
Can this be done with only SQL(ite) statements? The only ways I can think of require a lot of Java code to parse the table.
Thanks in advance…
You should be able to do this with a subquery (Warning: Untested). For example if
X==10,