Hi,It is better to post some raw data and the expected output. (i don't know much about Oracle)so , i created an example, maybe will guide you.;WITH EMPAS (SELECT 1 AS employee_id , NULL AS manager_id , 'Manag First' AS first_name , 'LastName ' AS last_name UNION ALL SELECT 2 , 1 , 'Emp 2 F', 'Emp2 Last'UNION ALL SELECT 3 , 2 , '3 First', 'Last'UNION ALL SELECT 4 , 2 , '4 First', 'Last'UNION ALL SELECT 5 , 3 , '5 First', 'LastName'UNION ALL SELECT 6 , 3 , '6 First', 'Last') ,cte_EmpAS ( SELECT employee_id ,NULL AS manager_ID, CAST('' AS VARCHAR(20)) AS Name , 0 as LVL FROM EMP WHERE manager_id IS NULL UNION ALL SELECT E.employee_id , E.manager_id, CAST(C.name +'/'+ RiGHT(REPLACE(STR(E.manager_id),' ','0') ,3) AS VARCHAR(20)), LVL+ 1 FROM cte_Emp AS c INNER JOIN Emp AS E ON E.manager_id = c.employee_id )SELECT * FROM cte_Emp
and the output:employee_id manager_ID Name LVL1 NULL 02 1 /001 13 2 /001/002 24 2 /001/002 25 3 /001/002/003 36 3 /001/002/003 3
sabinWeb MCP