Oracle-hierarchical statements-tree structure-show root nodes-not show root nodes

Source: Internet
Author: User

Oracle-hierarchical statements-tree structure-show root nodes-not show root nodes. the tree structure area_id of the Oracle-level statement is that the common primary key ID corresponds to parent_id .. administrative Division table 1. start with t. parent_id here is parent_id and does not display the top root node, so there will be multiple

[SQL] select t. * from HM_F_AREA t where length (t. area_id) = 6 start with t. parent_id = '2013' connect by t. parent_id = PRIOR t. area_id

 

2. start with t. id. If it is ID, the root is displayed, with only one root.
[SQL] select t. * from HM_F_AREA t where length (t. area_id) = 6 start with t. area_id = '000000' connect by t. parent_id = PRIOR t. area_id

 

.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.