关键字:level connect by level
一、实验一
--查询没有被使用过的工号。 with all_used_empno as (select level poss_empno from (select max(empno) max_empno from emp) connect by level <= max_empno) select poss_empno from all_used_empno where poss_empno not in (select empno from emp) order by poss_empno;
实验二、得到1-10的序列值。
select level from dual connect by level <=10