当前位置:Gxlcms > mysql > 获取最小可用id语句

获取最小可用id语句

时间:2021-07-01 10:21:17 帮助过:45人阅读

获取最小可用id语句 其中SELECT rownum id from dual connect by rownum=9 改成相应的最小值最大值区间,比如:www.2cto.com SELECT rownum+rpad(2010,7,0) id from dual connect by rownum=rpad(2010,7,9) Sql代码 select id from (SELECT rownum id from d


获取最小可用id语句

其中SELECT rownum id from dual connect by rownum<=9

改成相应的最小值最大值区间,比如:www.2cto.com

SELECT rownum+rpad('2010',7,'0') id from dual connect by rownum<=rpad('2010',7,'9')

Sql代码

select id from (SELECT rownum id from dual connect by rownum<=9) a where not exists
(select id from tab where id= a.id)

人气教程排行