oracle 在oracle中将记录从一张表插入到另一张表
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9578566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
inserting records from one table to another in oracle
提问by Bhadra
My problem is, i have two table namely enq_tab and feed_back_tab. i need to insert some columns from enq_tab into feed_back_tab and some columns are from a webpage ie, a jsp...
我的问题是,我有两个表,即 enq_tab 和 feed_back_tab。我需要将 enq_tab 中的一些列插入到 feed_back_tab 中,而一些列来自网页,即 jsp ...
ex: enq_tab: enq_id,name,email,mobile,address,enq_date are columns; feed_back_tab:enq_id,name,email,mobile,address,enq_date,feed_back,comments,suggestions are columns
ex: enq_tab: enq_id,name,email,mobile,address,enq_date 是列;feed_back_tab:enq_id,name,email,mobile,address,enq_date,feed_back,comments,suggestions 是列
here i will get the feed_back,comments, suggestions from the JSP , and remaining columns from the enq_tab based on enq_id, which already present in database.
在这里,我将获得来自 JSP 的反馈、评论、建议,以及基于 enq_id 的 enq_tab 中的剩余列,这些列已经存在于数据库中。
anybody help me with some suggestions..
任何人都可以帮助我提出一些建议..
Thank in advance..
预先感谢..
回答by Balaswamy Vaddeman
I think you can do this way.
我认为你可以这样做。
insert into table1(COL1,COL2,COL3,COL4)
select col1,col2,jspvaribalevalue1,jspvariblevalue2 from table2