假设表TTT中没有重复的数字,现在要获得其中最小的未被使用的正整数
select nvl(max(n+1),1) minInt from (select n,n-row_number(order by n) cha from ttt) where cha=0
[@more@]来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29867/viewspace-809713/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29867/viewspace-809713/