Retrieving a path with SYS_CONNECT_BY_PATH v16
SYS_CONNECT_BY_PATH is a function that works in a hierarchical query to retrieve the column values of a specified column that occur between the current node and the root node.
The signature of the function is:
The function takes two arguments:
columnis the name of a column that resides in a table specified in the hierarchical query that's calling the function.
varcharvalue that separates each entry in the specified column.
This example returns a list of employee names and their managers. If the manager has a manager, that name is appended to the result.
In the result set:
levelcolumn displays the number of levels that the query returned.
enamecolumn displays the employee name.
managerscolumn contains the hierarchical list of managers.
The EDB Postgres Advanced Server implementation of
SYS_CONNECT_BY_PATH doesn't support use of: