EMP_NO EMP_NAME EMP_DEPTID SALARY
----------- -------------- ---------------- -----------
1 aaa 3 8000
2 bbb 5 12500
3 ccc 6 1200
4 ddd 4 500
with data
as
(select level-1 l from dual connect by level < = 100 )
select emp_no, emp_name
from nz_test1, data
where l < emp_deptid
order by 1, 2;
EMP_NO EMP_NAME EMP_DEPTID SALARY
----------- --------------- ---------------- ----------
1 aaa 3 8000
1 aaa 3 8000
1 aaa 3 8000
2 bbb 5 12500
2 bbb 5 12500
2 bbb 5 12500
2 bbb 5 12500
2 bbb 5 12500
3 ccc 6 1200
3 ccc 6 1200
3 ccc 6 1200
3 ccc 6 1200
3 ccc 6 1200
3 ccc 6 1200
4 ddd 4 500
4 ddd 4 500
4 ddd 4 500
4 ddd 4 500
18 rows selected
No comments:
Post a Comment