En løsning uden hardkodning af 9:
select min_a - 1 + level
from ( select min(a) min_a
, max(a) max_a
from test1
)
connect by level <= max_a - min_a + 1
minus
select a
from test1
Resultater:
MIN_A-1+LEVEL
-------------
7003
7007
7008
7009
4 rows selected.