一:目标表不存在

   sqlserver:select * into 目标表(新表) from 原表 where ...

  mysql:create table 目标表(新表) as select * from 原表 where ...

二:目标表已存在

  a. 保存全部

    insert into 目标表 select * from 原表 where ...

  b. 保存指定列

    insert into 目标表(列a, b, c) select 列a, b, c from 原表 where ...

三:跨数据库操作,把A数据库的atable表所查询的东西,插入到B 数据库的btable表中

  select * into B.btable from A.atable where ...

 

 

 

星光不问赶路人,时光不负有心人。

相关文章:

  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2023-03-11
  • 2021-06-01
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案