高手们,可以从不同的把来自不同表的数据同时插入到一个表中吗? insert tabN(f1,f2,f3....) select f1,f2,f3...... from tabAunion allselect f1,f2,f3...... from tabBunion allselect ...... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert tabN(f1,f2,f3....) select * from(select a.f1,a.f2,b.f2,b.f4... from table1 a,table2 b where a.col=b.col)a insert tabN(f1,f2,f3....) select f1,f2,f3...... from tabAunion allselect f1,f2,f3...... from tabBunion allselect ...... insert tabN(f1,f2,f3....) select * from(select a.f1,a.f2,b.f2,b.f4... from table1 a,table2 b where a.col=b.col)a 不好意思,刚才搞错了,我是说用两个不同表的不同字段。两个源表没有重复字段insert tabN(f1,f2,f3) select a的列1,a的列2,a的列3 from 表aunion allselect b的列1,b的列2,b的列3 from 表b 还是用join???insert tabN(f1,f2,f3) select a.列1,b.列2,a.列2 from 表a a join 表b b on a.列1=b.列1 64位系统备份sql32位系统下还原失败 求一sql语句优化 查询问题? Transact-SQL 中一个简单的问题 使用linked servers连接到oracle database得到中文字符乱码问题. 邹哥和各位大侠,请对该数据库表查询优化的探讨 在线急等高手援助,语句有问题执行不了 表中删除一条记录时出现“对象名‘MLists_Users'无效”的错误 表达式的SQL语句如何书写 各位高手,请教一下,sql server olap的前端展现工具是什么? vb可以访问吗? 想问问有关datetime的问题? 挑战::对于以下数据库怎样查询统计。
select * from
(select a.f1,a.f2,b.f2,b.f4... from table1 a,table2 b where a.col=b.col)a
select f1,f2,f3...... from tabA
union all
select f1,f2,f3...... from tabB
union all
select ......
select * from
(select a.f1,a.f2,b.f2,b.f4... from table1 a,table2 b where a.col=b.col)a
insert tabN(f1,f2,f3) select a的列1,a的列2,a的列3 from 表a
union all
select b的列1,b的列2,b的列3 from 表b