SELECT * FROM nTree ( ON input_table PARTITION BY partition_columns [ ORDER BY ordering_columns ] Root_Node (boolean_expression) Node_ID (expression) Parent_ID (expression) Allow_Cycles ({'true'|'yes'|'t'|'y'|'1'|'false'|'no'|'f'|'n'|'0'}) Starts_With ({ 'root' | 'leaf' | expression }) Mode ({ 'up' | 'down' }) Output ({ 'end' | 'all' }) [ Max_Distance (expression) ] [ Logging ({'true'|'yes'|'t'|'y'|'1'|'false'|'no'|'f'|'n'|'0'})] Result (aggregate [,...]) );