DB2 Version 9.7 for Linux, UNIX, and Windows

CONNECT_BY_ROOT unary operator

The CONNECT_BY_ROOT unary operator is for use only in hierarchical queries (SQLSTATE 428H4). For every row in the hierarchy, this operator returns the expression for the row's root ancestor.

Read syntax diagramSkip visual syntax diagram
>>-CONNECT_BY_ROOT--expression---------------------------------><

expression
An expression that does not contain a NEXT VALUE expression, an hierarchical query construct (such as the LEVEL pseudocolumn), the SYS_CONNECT_BY_PATH function, or an OLAP function (SQLSTATE 428H4).

The result type of the operator is the result type of the expression.

Rules:

Notes:

Example: