CONNECT BY的标准替代品? [英] Standard alternative to CONNECT BY?

查看:92
本文介绍了CONNECT BY的标准替代品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试转换一些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的标准替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆