插入到android sqlite数据库中的特定行 [英] Insert into specific row in android sqlite database

查看:31
本文介绍了插入到android sqlite数据库中的特定行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种将新条目插入到 android 中的 sqlite 数据库中的特定行的方法.基本思想是数据库存储这样的条目:

I'm looking for a way to insert a new entry into a specific row in an sqlite database in android. The basic idea is that the database stores entries like this:

id   day        time
1   Monday     09:00
2   Monday     11:00
3   Tuesday    10:00

ID 列是自动递增的.这个想法是,如果你想插入一个新条目星期一 10:00",它应该插入到数据库中的 id 2,其他条目会相应地更新,即条目星期一 11:00"将变成 id 3等

the ID column is auto incremented. The idea is that if you wanted to insert a new entry of "Monday 10:00" it should be inserted into the database at id 2, and the other entries would update accordingly i.e. the entry "Monday 11:00" would become id 3 etc.

简而言之,有没有办法将数据插入特定行?如果有,它会自动更改其他条目吗?

In short, is there any way to insert data into a specific row? If there is, will it automatically change the other entries?

谢谢

推荐答案

简短的回答,没有.自动增量意味着您无法控制该字段.

Short answer, no. Auto increment means you don't control the field.

这篇关于插入到android sqlite数据库中的特定行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆