- 1、本文档共9页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
详解oracle递归(详解oracle递归)
详解oracle递归(详解oracle递归)
I. grammar
General wording: select * from some_table [where condition 1] connect by [condition 2] start with [condition 3];
The order in which the connect, by, and start with statements are placed does not affect the results of the query, and the [where condition 1] may not be required.
[where conditions 1], [condition 2]] [condition 3]] each function is not the same range:
The [where condition 1] is filtered in the record selected under the connect by [conditional 2] start with [conditional 3]], filtering for a single record, without considering the tree structure;
[condition 2] specifies the condition of the constructed tree and the filter condition for the branch of the tree, where the filtered filter filters the qualified records and all the child nodes under them;
[condition 3] defines the condition as the starting point of the search, and if the top-down search is qualified as the root node condition, if the bottom-up search is qualified as a leaf node condition;
Example:
If there is a list of the following structures: some_table (ID, p_id, name), where p_id holds the ID of the parent record.
Select * from, some_table, where, t.id, =123, connect, prior, t.p_id=t.id, and, t.p_id, =321, start, by, with, t, t.p_id=33, or, t.p_id=66;
Description of prior:
Prior exists in condition 2], you can not, no, you can only find records that conform to the start with [condition 3] , and are not looking for the child nodes of these records.. To a time when there are two way: connect by prior t.p_id=t.id by t.p_id=prior or connect t.id, the first sign said with a top-down search method (first find the parent node and child nodes, after looking for) a style of representation using a bottom-up search method (first to find the leaf node and then find the parent node).
Two. Execution principle
The implementation principles of connect by... Start with... Can be explained by the execution of the following program and the tuning of the stored procedure RECURSE
您可能关注的文档
- 自我心理训练和调整(Self psychological training and adjustment).doc
- 自控专业工程设计用标准及规范(Standard and specification for engineering design of automatic control specialty).doc
- 自制蛋糕面包档(Homemade cake roll).doc
- 自然光摄影(Natural light photography).doc
- 自来水的应用(Application of tap water).doc
- 自行车初级训练法则(Basic training rules for bicycles).doc
- 自考英语(二)词形变化应试技巧(Self taught English (two) change form examination skills).doc
- 自适应滤波算法(Adaptive filtering algorithm).doc
- 自我装修监理手册(Handbook of self decoration supervision).doc
- 自闭历程读后感(The course of autism).doc
文档评论(0)