<cfquery datasource="HR" name="qryHier">
SELECT employee_id, manager_id,
last_name || ' ' || first_name AS Employee, -- Padding to better show the hierarchy
LEVEL, -- Pseudo Oracle column indicate the nested level
CONNECT_BY_ROOT last_name  His_Boss, -- Indicate who is the GranFather
DECODE(CONNECT_BY_ISLEAF, 1, 'No', 'Yes') has_kids, -- Indicate if there are children for the node
SYS_CONNECT_BY_PATH (last_name, ' ->') hierarchy_path -- Indicate the node path

FROM employees

CONNECT BY PRIOR employee_id = manager_id -- Indicate the field in relationship
START WITH manager_id IS NULL -- Indicate from wich level to start
ORDER SIBLINGS BY manager_id -- Mantain the natural order
</cfquery>

<cfquery datasource="HR" name="qrySelected">
SELECT employee_id, manager_id,
last_name || ' ' || first_name AS Employee

FROM employees
WHERE last_name LIKE '%ki%'

ORDER BY last_name
</cfquery>

<cfif isDefined("form.treeitem")>
<strong>POST form.treeitem:</strong> <cfoutput>#form.treeitem#</cfoutput>
</cfif>

<form action="" method="post">

<cf_treeControl queryTree="#qryHier#" itemValue="employee_id" itemDisplay="employee" itemParent="manager_id"
                                querySelected="#qrySelected#" selectedValue="employee_id" selectedDisplay="Employee" />

<br>

<input type="submit" name="send" value="send">
</form>