<i id='QHupc'><tr id='QHupc'><dt id='QHupc'><q id='QHupc'><span id='QHupc'><b id='QHupc'><form id='QHupc'><ins id='QHupc'></ins><ul id='QHupc'></ul><sub id='QHupc'></sub></form><legend id='QHupc'></legend><bdo id='QHupc'><pre id='QHupc'><center id='QHupc'></center></pre></bdo></b><th id='QHupc'></th></span></q></dt></tr></i><div id='QHupc'><tfoot id='QHupc'></tfoot><dl id='QHupc'><fieldset id='QHupc'></fieldset></dl></div>
        <bdo id='QHupc'></bdo><ul id='QHupc'></ul>

      <small id='QHupc'></small><noframes id='QHupc'>

        <tfoot id='QHupc'></tfoot>

      1. <legend id='QHupc'><style id='QHupc'><dir id='QHupc'><q id='QHupc'></q></dir></style></legend>

        Oracle 11G 中的 INSERT SELECT 语句

        时间:2023-09-18

      2. <legend id='UMl2n'><style id='UMl2n'><dir id='UMl2n'><q id='UMl2n'></q></dir></style></legend>

          <tfoot id='UMl2n'></tfoot>

            <small id='UMl2n'></small><noframes id='UMl2n'>

              <bdo id='UMl2n'></bdo><ul id='UMl2n'></ul>
                  <tbody id='UMl2n'></tbody>
                <i id='UMl2n'><tr id='UMl2n'><dt id='UMl2n'><q id='UMl2n'><span id='UMl2n'><b id='UMl2n'><form id='UMl2n'><ins id='UMl2n'></ins><ul id='UMl2n'></ul><sub id='UMl2n'></sub></form><legend id='UMl2n'></legend><bdo id='UMl2n'><pre id='UMl2n'><center id='UMl2n'></center></pre></bdo></b><th id='UMl2n'></th></span></q></dt></tr></i><div id='UMl2n'><tfoot id='UMl2n'></tfoot><dl id='UMl2n'><fieldset id='UMl2n'></fieldset></dl></div>

                1. 本文介绍了Oracle 11G 中的 INSERT SELECT 语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在 Oracle 11g 中运行一个非常简单的 sql 语句.

                  I'm trying to run a very simple sql statement in Oracle 11g.

                   insert into table1 (col1, col2) values (select t1.col1, t2.col2 from oldtable1 t1, oldtable2 t2);
                  

                  非常简单的查询.笛卡尔将旧表 1 连接到旧表 2,将结果值放入表 1.

                  Very simple query. Cartesian join old table 1 to old table 2, put the resulting values into table 1.

                  我自己运行了子查询,它运行良好.

                  I've run the subquery by itself, and it works perfectly.

                   select t1.col1, t2.col2 from oldtable1 t1, oldtable2 t2
                  

                  当我尝试运行完整语句时,出现以下错误:

                  When I try to run the full statement, I get the following error:

                   SQL Error: ORA-00936: missing expression
                   00936. 00000 -  "missing expression"
                  

                  我也无法让它在 MySql 中工作.我的陈述有问题,但我不确定是什么.

                  I can't get it to work in MySql either. Something is wrong with my statement, but I'm not sure what it is.

                  推荐答案

                  您的查询应该是:

                  insert into table1 (col1, col2) 
                  select t1.col1, t2.col2 
                  from oldtable1 t1, oldtable2 t2
                  

                  即没有 VALUES 部分.

                  这篇关于Oracle 11G 中的 INSERT SELECT 语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何处理 SELECT 语句中的 to_date 异常以忽略这些行? 下一篇:oracle中的自动增量到已经创建的表

                  相关文章

                    <legend id='7sSEK'><style id='7sSEK'><dir id='7sSEK'><q id='7sSEK'></q></dir></style></legend>

                      <small id='7sSEK'></small><noframes id='7sSEK'>

                      <i id='7sSEK'><tr id='7sSEK'><dt id='7sSEK'><q id='7sSEK'><span id='7sSEK'><b id='7sSEK'><form id='7sSEK'><ins id='7sSEK'></ins><ul id='7sSEK'></ul><sub id='7sSEK'></sub></form><legend id='7sSEK'></legend><bdo id='7sSEK'><pre id='7sSEK'><center id='7sSEK'></center></pre></bdo></b><th id='7sSEK'></th></span></q></dt></tr></i><div id='7sSEK'><tfoot id='7sSEK'></tfoot><dl id='7sSEK'><fieldset id='7sSEK'></fieldset></dl></div>

                      • <bdo id='7sSEK'></bdo><ul id='7sSEK'></ul>

                    1. <tfoot id='7sSEK'></tfoot>