我正在尝试转换一些Oracle SQL查询以在理论上与任何SQL数据库一起使用.一些查询本质上是分层的,是使用CONNECT BY编写的.
I'm trying to convert some Oracle SQL queries to work with (in theory) any SQL database. Some of the queries are hierarchical in nature and are written using CONNECT BY.
是否有标准的SQL替代Oracle的START WITH ... CONNECT BY语法?还是我应该遵循一些建议的过程来转换分层查询?
Is there a standard SQL alternative to Oracle's START WITH...CONNECT BY syntax? Or is there some recommended process I should follow to convert the hierarchical queries?
推荐答案在Oracle 11gR2中,它们支持通用表表达式中的递归(大多数Oracle人将其称为子查询因子,即WITH子句).由于这是ANSI的处理方式,因此应该更加可移植.
In Oracle 11gR2 they support recursion in Common Table Expressions (what most Oracle people know as sub-querying factoring, i.e. the WITH clause). As this is the ANSI way of doing things it ought to be more portable.
Tom Kyte在 11月9日的Oracle杂志上.
Tom Kyte writes about Recursive Subquery Factoring in the November 09 edition of Oracle magazine.
更多推荐
CONNECT BY的标准替代品?
发布评论