views:

169

answers:

1

Hi everybody,

My question is quite straightforward. I have a table, with, lets say x rows, with each an id, but i don't know how many rows i have. Now i want to delete the last row of my table for some reason... Is there an easy way to do that in android? I have been trying to use the last_insert_rowid in my where clause...but no luck so far... any idea to do that with the sqlite database tools of android? thx for help

+1  A: 

I assume that last_insert_rowid means that you are talking about db.

DELETE FROM test WHERE id = (SELECT MAX(id) FROM test);
skyman
seems to work. thanks
Sephy