MySQL查询SubQueries中列的插入顺序

时间:2017-02-06 09:32:19

标签: mysql

此处第一个表的列顺序与第二个表不同。

insert into storagejobsforreport
select *
from storagejobs
where CustomerId = 2;

如何将其正确插入每个列中。 table.i中的列不要按顺序写下所有列的名称。

1 个答案:

答案 0 :(得分:0)

你必须这样做

insert into storagejobsforreport (col1, col2,..)
select col1, col2...
from storagejobs
where CustomerId = 2;
相关问题