将表中的一行复制到另一行并在同一查询中插入一列的值

Bab*_*bar 3 mysql copy insert

我正在从 table2 复制 column1、column2 但想手动在 table1 中插入 column3 的值...我该怎么办?请帮忙

INSERT INTO table1( column1, column2, column3) 
SELECT column1, column2
FROM table2
WHERE  `id` =  '1'
Run Code Online (Sandbox Code Playgroud)

Ruf*_*nus 5

喜欢

INSERT INTO table1( column1, column2, column3) 
SELECT column1, column2, 'My String' as column3
FROM table2
WHERE  `id` =  '1'
Run Code Online (Sandbox Code Playgroud)