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

后端 未结 4 747
半阙折子戏
半阙折子戏 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:25

    No. You need to know the schema of the table to write the insert statement properly.

    You need to be able to write the statement in the form of:

    insert into Table (column1, column2, column3) 
    select column1, column2, column3
    from OtherTable
    where rowId = 5
    

提交回复
热议问题