column nm format a20
clear screen
set pause on
with emp_data(ename,empno,mgr,l)
as
(select /*+ materialize */ ename, empno, mgr, 1 lvl from emp where mgr is null
 union all
 select emp.ename, emp.empno, emp.mgr, ed.l+1
   from emp, emp_data ed
  where emp.mgr = ed.empno
)
SEARCH DEPTH FIRST BY ename SET order_by
select l,
       lpad('*',2*l,'*')||ename nm
  from emp_data
 order by order_by
/
set pause off
pause

clear screen
with data(r)
as
(select 1 r from dual
 union all
 select r+1 from data where r < 5
)
select r, sysdate+r
  from data;
pause
