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

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

    2. <tfoot id='OEZ21'></tfoot>

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

        在 Oracle 中不使用 FROM 子句进行选择

        时间:2023-09-17

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

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

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

                  本文介绍了在 Oracle 中不使用 FROM 子句进行选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  SQL Server中可以执行SELECT,而无需参考表;类似:

                  选择 1.2 +3, 'my dummy string'

                  由于Oracle 不允许没有FROM 的SELECT,因此我使用双表进行此类操作;类似:

                  从 DUAL 中选择 1,2+3, 'my dummy string'

                  有没有更好的方法来做这种类型的查询?使用双表是个好习惯吗?

                  解决方案

                  不,在Oracle中没有SELECT没有FROM.

                  使用 dual 表是一个好习惯.

                  dual 是一个内存表.如果您不从中选择 DUMMY,它将使用不需要 I/O 的特殊访问路径 (FAST DUAL).>

                  曾几何时,dual 有两条记录(因此得名),旨在作为虚拟记录集来复制被连接的记录.

                  现在它只有一条记录,但你仍然可以用它生成任意数量的行:

                  SELECT 级别从双联系方式等级 <= 100

                  MySQL 还支持 dual(以及 fromless 语法).

                  in SQL Server is possible to execute a SELECT, without reference to a table; something like:

                  Select 1.2 +3, 'my dummy string'
                  

                  As Oracle does not allow a SELECT without a FROM, I use the dual table for this type of operation; something like:

                  Select 1,2+3, 'my dummy string' FROM DUAL
                  

                  There is a better way of doing this type of query? it is good practice to use the dual table?

                  解决方案

                  No, in Oracle there is no SELECT without FROM.

                  Using the dual table is a good practice.

                  dual is an in-memory table. If you don't select DUMMY from it, it uses a special access path (FAST DUAL) which requires no I/O.

                  Once upon a time, dual had two records (hence the name) and was intended to serve as a dummy recordset to duplicate records being joined with.

                  Now it has but one record, but you can still generate an arbitrary number of rows with it:

                  SELECT  level
                  FROM    dual
                  CONNECT BY
                          level <= 100
                  

                  MySQL also supports dual (as well as the fromless syntax).

                  这篇关于在 Oracle 中不使用 FROM 子句进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 SQL Server 中,如何以类似于 Oracle 的“SELECT FOR UPDATE WAIT"的 下一篇:ORACLE IIF 声明

                  相关文章

                    <bdo id='jupwu'></bdo><ul id='jupwu'></ul>

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

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