看一些sql的reference不就行了吗,我懒得翻译了
If a table contains hierarchical data, you can select rows in a hierarchical order using the hierarchical query clause:
n START WITH specifies the root row(s) of the hierarchy.
n CONNECT BY specifies the relationship between parent rows and child rows of the hierarchy. Some part of conditionmust use the PRIOR operator to refer to the parent row.
n WHERE restricts the rows returned by the query without affecting other rows of the hierarchy.
Oracle uses the information from the hierarchical query clause clause to form the hierarchy using the following steps:
1. Oracle selects the root row(s) of the hierarchy—those rows that satisfy the
START WITH condition.
2. Oracle selects the child rows of each root row. Each child row must satisfy the
condition of the CONNECT BY condition with respect to one of the root rows.
3. Oracle selects successive generations of child rows. Oracle first selects the
children of the rows returned in step 2, and then the children of those children,
and so on. Oracle always selects children by evaluating the CONNECT BY
condition with respect to a current parent row.
4. If the query contains a WHERE clause, Oracle eliminates all rows from the
hierarchy that do not satisfy the condition of the WHERE clause. Oracle evaluates
this condition for each row individually, rather than removing all the children
of a row that does not satisfy the condition.
5. Oracle returns the rows