android - sqlite插入数据,主键重复怎么办
PHP中文网
PHP中文网 2017-04-17 17:31:03
0
2
655

由于需要,没有设置主键自增,现在插入数据,如果主键相同,数据会被覆盖吗?

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
左手右手慢动作

The inserted data is new and will not be overwritten. However, if the primary key is set to be unique, an error will be reported when inserting the same primary key. When the auto-incrementing primary key is not used, in order to ensure uniqueness, UUID/GUID is usually used instead

阿神

1. The primary key is unique. If they are the same, an error will be reported when inserting data. 2. You can use a composite primary key. I suggest you read a book on databases.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template