如何将sql查询结果(不止一项)插入到一张表中,我们一般可以用如下形式的sql

insert into table1(field1,field2,...)

select field1,field2,... from table2

where ...

它要求对应的插入项类型必须一致

另外,当select的查询结果是table1的所有字段的时候,可以省略table1的列字段,写成如下形式:

insert into table1

select field1,field2,... from table2

where ...

相关文章:

  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-02
  • 2021-10-31
  • 2021-07-07
  • 2021-05-23
  • 2022-02-12
相关资源
相似解决方案