आप यह कर सकते हैं:
select 1 + min(col)
from t
where not exists (select 1 from t t2 where t2.col = t.col + 1);
यदि आपको "1" शामिल करने की आवश्यकता है, तो:
select (case when min(tt.mincol) <> 1 then 1
else 1 + min(col)
end)
from t cross join
(select min(col) as mincol from t) tt
where not exists (select 1 from t t2 where t2.col = t.col + 1)