Select, Modify and insert into the same table

后端 未结 3 1250
轻奢々
轻奢々 2020-12-30 00:58

What\'s the easiest way to select a row, modify couple of columns and insert it to the same table? I\'m trying to insert a new row based on another.

3条回答
  •  余生分开走
    2020-12-30 01:38

    INSERT INTO table(column1,column2) SELECT column1, const2 FROM table ...
    

    The select list will likely mix copied columns (by name) and changed columns (by desired values).

提交回复
热议问题