一:如果要插入目标表不存在: select * into 目标表 from 表 where ... 二:如果要插入目标表已经存在: insert into 目的表 select * from 表 where 条件 三:如果是跨数据库操作的话: 怎么把A数据库的atable表所查询的东西,全部插入到B 数据库的btable表中 select * into B.btable from A.atable where ... 同样,如果是跨服务器的,也是可以的. Select * from #Tmp -
一:如果要插入目标表不存在: select * into 目标表 from 表 where ... 二:如果要插入目标表已经存在: insert into 目的表 select * from 表 where 条件 三:如果是跨数据库操作的话: 怎么把A数据库的atable表所查询的东西,全部插入到B 数据库的btable表中 select * into B.btable from A.atable where ... 同样,如果是跨服务器的,也是可以的.
下面这段代码执行效率是极慢的(根本没执行完成过): select /*+ parallel(16) */ z.small_code,trunc(hs.CREATED_AT),sum(hs.COST_SCORE) from zfs_hpoint_spend_patched_v hs join hpoint h on h.hpt_id = hs.hpt_id join zfs_rhaierpointoperationtype_v z on z.small_id = h.hpt_attr1 wh