Tree structure query

zhaozj2021-02-16  81

Frequent tables to store tree structures such as unit organization

Two words in the SELECT statement

Connect by Prior Conditions

START WITH condition

Connect By is a connection to the "zipper", and the prior represents the execution of the parent child relationship query start with where to start from top, from the bottom

In the table of the tree structure, each tuple can have a layer number (Level), a more node is 1

Available system variables LEVEL

SELECCCT Level. . . Connect by. . .

Branch query:

转载请注明原文地址:https://www.9cbs.com/read-13895.html

New Post(0)