获取最小可用id

值区间示例:

 select id from (select id from (SELECT rownum id from dual connect by rownum<= rpad(12,7,'9')) where id > rpad(12,7,'0')) a

 

 

 

(select id from (SELECT rownum id from dual connect by rownum<= rpad(12,7,'9')) where id > rpad(12,7,'0')) a
where not exists (select id FROM tab where tab like'12%' and id = a.id) 
 

 

你可能感兴趣的:(id)