<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 子句进行选择

        Select without a FROM clause in Oracle(在 Oracle 中不使用 FROM 子句进行选择)

              <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 子句进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                    <bdo id='jupwu'></bdo><ul id='jupwu'></ul>

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

                              <tbody id='jupwu'></tbody>

                          • <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>
                          • <tfoot id='jupwu'></tfoot>