简体   繁体   English

Oracle 12c文档,用于SQL的更改/新功能

[英]Oracle 12c documentation for changes / new features to SQL

I just found out that Oracle 12c supports correlating a query several levels deep which is unsupported in 11g and previous versions. 我刚刚发现Oracle 12c支持将几个级别的查询关联起来,这在11g和以前的版本中是不受支持的。

select
   *
from
   tab1 a
where
   not exists
         (select
                *
           from
               (select
                    *
                from
                    tab2 b
                where a.X = b.X))

But I could not find this documented in Oracle website. 但我无法在Oracle网站上找到这个文档。 Is there any other such hidden SQL features added to Oracle 12c? 是否有任何其他此类隐藏的SQL功能添加到Oracle 12c? Are all such changes to SQL in 12c documented somewhere? 在12c中对SQL的所有这些更改是否记录在某处?

To explain this we need to dive into history a little bit. 为了解释这一点,我们需要深入了解历史。

Ability to use correlated sub-queries with more than 1 level was also in Oracle 10g R1 and it was properly documented ( https://docs.oracle.com/cd/B14117_01/server.101/b10759/queries007.htm ) back those days... 能够使用超过1级的相关子查询的能力也在Oracle 10g R1中,并且已正确记录( https://docs.oracle.com/cd/B14117_01/server.101/b10759/queries007.htm )天...

Oracle performs a correlated subquery when a nested subquery references a column from a table referred to a parent statement any number of levels above the subquery . 当嵌套子查询从引用父语句的表引用子查询上方任意数量级别的列时,Oracle会执行相关子查询

... but it was not properly working. ......但它没有正常工作。 :) :)

So starting with Oracle 10g R2 this functionality was disabled and documentation had changed. 因此,从Oracle 10g R2开始,此功能已被禁用,文档已更改。

Also (if you have an access) you can see Bug 15990897 : QUERY WITH CORRELATED VARIABLE USED IN 2ND LEVEL SUBQUERY FAILS WITH ORA-904 on Metalink ( Fixed in Product Version 12.1.0.1.0 ). 另外(如果您有访问权限),您可以在Metalink上看到错误15990897:使用ORA-904在2级级别的子故障中使用的相关变量查询在产品版本12.1.0.1.0中已修复 )。 I'm not sure why it's considered as a bug given that it works according to documentation (10g R2, 11g R1, 11g R2) but that is how it is. 我不确定为什么它被视为一个错误,因为它根据文档(10g R2,11g R1,11g R2)工作,但事实就是这样。

So, functionality was disabled after 10.1 and before 12.1 but documentation even for 12.2 ( https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Using-Subqueries.html ) says 因此,功能在10.1之后和12.1之前被禁用,但是文档甚至12.2( https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Using-Subqueries.html )说

Oracle performs a correlated subquery when a nested subquery references a column from a table referred to a parent statement one level above the subquery. 当嵌套子查询引用从子查询上方一级的父语句引用的表中的列时,Oracle会执行相关子查询。

Cut a long story short, this functionality is enabled in 12c R1 and 12c R2 but documentation is not fixed and apparently there is no mentioning about this improvement in New Features guide. 简而言之,此功能在12c R1和12c R2中启用,但文档并未修复,显然在新功能指南中没有提及此改进。

PS. PS。 As far as I remember standard SQL 2003 allows correlation only to one level deep - everyone is welcome to check ( http://www.wiscorp.com/sql_2003_standard.zip ). 据我所知,标准SQL 2003只允许相关性达到一个级别 - 欢迎大家查看( http://www.wiscorp.com/sql_2003_standard.zip )。 But Oracle has a lot of improvements above the standard anyway. 但无论如何,Oracle在标准上有很多改进。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM