我正在使用insert into table2 select from table1
声明。
table2
有几个字段比table1
. 除了来自选择结果的值之外,我如何用其他值填充额外的字段。
table1
有col1, col2, col3 table2 has col1, col2, col3, col4, col5, col6
table2 中的 col4 和 col5 将使用 col2 和 col3 中的修改值。
例子:
tabl1.col2
有价值有价值tag 6512
_tabl1.col3
bin location
col4
intable2
将使用 table1.col3 中的部分值bin
和 table1.col2 中的“6512”,
所以table2.col4
将是bin 6512
sql:
insert into table2(col1, col2, col3, col4, col5) select * from table1 (and add values for col4 and col5)
任何帮助表示赞赏。