All,
iam using the emp table to fetch the next 2 upper level supervisors (if available) for a given employee as show below
SELECT ename, empno, mgr, job, LEVEL
FROM emp
START WITH empno = 7900 -- example 7698 passed as parameter
CONNECT BY empno = PRIOR mgr
AND LEVEL <= 3
now iam trying to transform all the rows returned ( at most 3 ) into columns to have only one record as below:
emp_name || supervisor1_name|| supervisor2_name|| empno1|| empno2|| empno3
JAMES BLAKE KING 7900 7698 7839
i think i should use the pivot but it didnt work for me - any help please?
Oracle 12 g
thanks.