• <small id='Hulg8'></small><noframes id='Hulg8'>

        <bdo id='Hulg8'></bdo><ul id='Hulg8'></ul>
      <legend id='Hulg8'><style id='Hulg8'><dir id='Hulg8'><q id='Hulg8'></q></dir></style></legend>

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

        使用 Oracle SELECT INTO

        SELECT INTO using Oracle(使用 Oracle SELECT INTO)
        • <bdo id='V5V7t'></bdo><ul id='V5V7t'></ul>
            <tfoot id='V5V7t'></tfoot>

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

                <legend id='V5V7t'><style id='V5V7t'><dir id='V5V7t'><q id='V5V7t'></q></dir></style></legend>
                  <tbody id='V5V7t'></tbody>

                • <i id='V5V7t'><tr id='V5V7t'><dt id='V5V7t'><q id='V5V7t'><span id='V5V7t'><b id='V5V7t'><form id='V5V7t'><ins id='V5V7t'></ins><ul id='V5V7t'></ul><sub id='V5V7t'></sub></form><legend id='V5V7t'></legend><bdo id='V5V7t'><pre id='V5V7t'><center id='V5V7t'></center></pre></bdo></b><th id='V5V7t'></th></span></q></dt></tr></i><div id='V5V7t'><tfoot id='V5V7t'></tfoot><dl id='V5V7t'><fieldset id='V5V7t'></fieldset></dl></div>
                • 本文介绍了使用 Oracle SELECT INTO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 Oracle 执行 SELECT INTO.我的查询是:

                  I'm trying to do a SELECT INTO using Oracle. My query is:

                  SELECT * INTO new_table FROM old_table;
                  

                  但我收到以下错误:

                  SQL Error: ORA-00905: missing keyword
                  00905. 00000 -  "missing keyword"
                  

                  知道有什么问题吗?

                  上面的标准行为应该是我原先认为的:然而,Oracle 用他们自己的 SQL 方言完全不同地实现了它插入 Oracle 文档...选择

                  The Standard behavior of the above should be as I originally thought: However Oracle implemented it totally differently in their own dialect of SQL Oracle Docs on Insert ... Select

                  推荐答案

                  如果 NEW_TABLE 已经存在,则 ...

                  If NEW_TABLE already exists then ...

                  insert into new_table 
                  select * from old_table
                  /
                  

                  如果你想根据 OLD_TABLE 中的记录创建 NEW_TABLE ...

                  If you want to create NEW_TABLE based on the records in OLD_TABLE ...

                  create table new_table as 
                  select * from old_table
                  /
                  

                  如果目的是创建一个新的但为空的表,则使用 WHERE 子句,其条件永远不会为真:

                  If the purpose is to create a new but empty table then use a WHERE clause with a condition which can never be true:

                  create table new_table as 
                  select * from old_table
                  where 1 = 2
                  /
                  

                  请记住,CREATE TABLE ... AS SELECT 仅创建一个与源表具有相同投影的表.新表没有原始表可能具有的任何约束、触发器或索引.那些仍然必须手动添加(如果需要).

                  Remember that CREATE TABLE ... AS SELECT creates only a table with the same projection as the source table. The new table does not have any constraints, triggers or indexes which the original table might have. Those still have to be added manually (if they are required).

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

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM(Oracle PL/SQL - 使用自定义 SQLERRM 引发用户定义的异常)
                  Oracle: is there a tool to trace queries, like Profiler for sql server?(Oracle:是否有跟踪查询的工具,例如用于 sql server 的 Profiler?)
                  How to handle Day Light Saving in Oracle database(如何在 Oracle 数据库中处理夏令时)
                  PL/SQL - Use quot;Listquot; Variable in Where In Clause(PL/SQL - 使用“列表Where In 子句中的变量)
                  Oracle: Import CSV file(Oracle:导入 CSV 文件)
                  How can multiple rows be concatenated into one in Oracle without creating a stored procedure?(如何在不创建存储过程的情况下在 Oracle 中将多行连接为一个?)

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

                  • <bdo id='xJaNM'></bdo><ul id='xJaNM'></ul>

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