How to insert duplicate rows in SQLite with a unique ID?

后端 未结 4 754
半阙折子戏
半阙折子戏 2021-02-05 16:16

This seems simple enough: I want to duplicate a row in a SQLite table:

INSERT INTO table SELECT * FROM table WHERE rowId=5;

If there were no ex

4条回答
  •  南旧
    南旧 (楼主)
    2021-02-05 16:36

    Absolutely no way to do this. Primary Key declaration implies this field is unique. You can't have a non unique PK. There is no way to create a row with existing PK in the same table.

提交回复
热议问题