You can use either of the 2 sql's
1)select nvl(max(a.t),0) + 1 gapfrom,b.t-1 gapto
from temp a ,temp b
where a.t(+) < b.t
group by b.t having nvl(max(a.t),0) < b.t -1;
2) select a.t +1,b.t -1 from temp a,temp b where
a.t +1 not in(select t from temp) and
b.t=(select min(t) from temp where t > a.t)
Cheers




Reply With Quote