开发者

Delete last row in a table android

My question is quite straightforward. I have a table, with, lets say x rows, with each an id, but I don't know how m开发者_开发知识库any 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?


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

DELETE FROM test WHERE id = (SELECT MAX(id) FROM test);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜