Code:
SQL> select 'mname is ' || case level when 1 then 'I''m the BOSS !!'
2 else connect_by_root ename end || chr(10) ||
3 'ename is ' || ename || chr(10) "Employees and Managers"
4 from scott.emp
5 where level = 2
6 or mgr is null
7 connect by prior empno = mgr;
Employees and Managers
---------------------------------------------
mname is SCOTT
ename is ADAMS
mname is FORD
ename is SMITH
mname is JONES
ename is SCOTT
mname is JONES
ename is FORD
mname is CLARK
ename is MILLER
mname is BLAKE
ename is ALLEN
mname is BLAKE
ename is WARD
mname is BLAKE
ename is JAMES
mname is BLAKE
ename is TURNER
mname is BLAKE
ename is MARTIN
mname is I'm the BOSS !!
ename is KING
mname is KING
ename is JONES
mname is KING
ename is CLARK
mname is KING
ename is BLAKE
14 rows selected.