oracle 语句insert into select from 如何用一个sql插入两个字段

我想往tableA中的a,b,c字段插值,但是b,c两个字段的值,得用一个SQL语句才能查出来
现请问用insert into select from语法怎么实现?
例:
insert tableA a, b, c
select b.x, (select 两列值 from ...where...) from tableB b, tableC c where ......
因为字段值要一一对应 所以在此例中 select语句查出的两个值对应的是tableA中的一列b
请问各位大神如何实现啊....

这个是可以的
sql:insert into tablename1(filename1,filename2) as select t2.filename1,t2.filename2 from tablename2 t2 where t2.id>5;
解释:从tablename2表中找到id大于5的 filenam1字段和filename2字段 插入到tablename1表中的filename1字段和filename2字段中;除此之外,表tablename1和表tablename2中的字段类型必须对应。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-06-11
select语句查出的两个值对应的是tableA中的一列b? 好难理解哦

insert tableA a, b, c
select b.x, (select 两列值 from ...where...) from tableB b, tableC c where ......
把你的语句调整下吧(select 两列值 from ...where...) ,这里的where 跟後面的tableB,C有关联吗?本回答被网友采纳
第2个回答  2014-06-11
你写的方法是对的,只不过子查询 (select 两列值 from ...where...) 的结果必需是只有一行,如果出现多行,查找一下原因,或者加rownum=1条件