In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Oracle's start with connect by prior queries "trees" recursively according to conditions, and is divided into four usage cases:
The first kind: start with child node ID='...' Connect by prior child node ID = parent node ID
one
Select * from mdm_organization o start with o. Orgliness codebook 10000008' connect by prior o.org_code=o.org_parent_code
According to the condition org_code='10000008', a recursive query is made on '10000008' (including itself) and its child nodes, and the result is as follows
Query results of all their own descendant nodes (including their own).
The second kind: start with child node ID='...' Connect by child node ID = prior parent node ID
one
Select * from mdm_organization o start with o. Orgliness codebook 10000008' connect by o.org_code=prior o.org_parent_code
According to the condition org_code='10000008', a recursive query is made on '10000008' (including itself) and its parent node, and the result is as follows
Query results of all the previous generation nodes (including themselves).
Third: start with parent node ID='...' Connect by prior child node ID = parent node ID
one
Select * from mdm_organization o start with o. Orgliness parentures codewords 10000008' connect by prior o.org_code=o.org_parent_code
According to the condition org_parent_code='10000008', the child node of '10000008' (excluding itself) is queried recursively, and the result is as follows
Query results are all descendant nodes of their own (excluding themselves).
Fourth: start with parent node ID='...' Connect by child node ID = prior parent node ID
one
Select * from mdm_organization o start with o. Orgkeeper parentures codewords 10000008' connect by o.org_code = prior o.org_parent_code
According to the condition org_parent_code='10000008', the first generation children of '10000008' (including themselves) and their parents are queried recursively, and the results are as follows
Query the results of their own first-generation post-nodes and all previous-generation nodes (including themselves).
If there are where conditions, the following
Select * from mdm_organization o where condition start with o. Orgliness parentors codewords 10000008' connect by o.org_code = prior o.org_parent_code
The order of execution is to execute start with connect by prior first, and then filter according to the where condition.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.