<tfoot id='7y58V'></tfoot>
    <legend id='7y58V'><style id='7y58V'><dir id='7y58V'><q id='7y58V'></q></dir></style></legend>

    1. <small id='7y58V'></small><noframes id='7y58V'>

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

        <bdo id='7y58V'></bdo><ul id='7y58V'></ul>

      如何在 Oracle 数据库中创建临时表?

      时间:2023-09-20

      <legend id='aWQil'><style id='aWQil'><dir id='aWQil'><q id='aWQil'></q></dir></style></legend>

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

        • <bdo id='aWQil'></bdo><ul id='aWQil'></ul>
            <tbody id='aWQil'></tbody>
              <tfoot id='aWQil'></tfoot>

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

                本文介绍了如何在 Oracle 数据库中创建临时表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想在 Oracle 数据库中创建一个临时表

                I would like to create a temporary table in a Oracle database

                类似的东西

                Declare table @table (int id)
                

                在 SQL 服务器中

                然后用select语句填充它

                And then populate it with a select statement

                有可能吗?

                谢谢

                推荐答案

                是的,Oracle 有临时表.这是AskTom<的链接/a> 描述它们的文章,这里是官方的 oracle CREATE表格文档.

                Yep, Oracle has temporary tables. Here is a link to an AskTom article describing them and here is the official oracle CREATE TABLE documentation.

                但是,在 Oracle 中,只有临时表中的数据是临时的.该表是其他会话可见的常规对象.在 Oracle 中频繁创建和删除临时表是一种不好的做法.

                However, in Oracle, only the data in a temporary table is temporary. The table is a regular object visible to other sessions. It is a bad practice to frequently create and drop temporary tables in Oracle.

                CREATE GLOBAL TEMPORARY TABLE today_sales(order_id NUMBER)
                ON COMMIT PRESERVE ROWS;
                

                <小时>

                Oracle 18c 添加了私有临时表,它们是单会话内存对象.请参阅 文档 了解更多详情.可以动态创建和删除私有临时表.


                Oracle 18c added private temporary tables, which are single-session in-memory objects. See the documentation for more details. Private temporary tables can be dynamically created and dropped.

                CREATE PRIVATE TEMPORARY TABLE ora$ptt_today_sales AS
                SELECT * FROM orders WHERE order_date = SYSDATE;
                

                <小时>

                临时表很有用,但它们在 Oracle 中经常被滥用.通常可以通过使用内联视图将多个步骤组合到单个 SQL 语句中来避免它们.


                Temporary tables can be useful but they are commonly abused in Oracle. They can often be avoided by combining multiple steps into a single SQL statement using inline views.

                这篇关于如何在 Oracle 数据库中创建临时表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 html 电子邮件中嵌入图像 下一篇:ORA-12505, TNS:listener 当前不知道连接描述符中给出的 SID

                相关文章

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

                    <small id='9iH4O'></small><noframes id='9iH4O'>

                    <tfoot id='9iH4O'></tfoot>