select floor(sysdate - to_date('20020405','yyyymmdd')) from dual;
create sequence users_id
minvalue 1
maxvalue 99999
start with 1
increment by 1;
create sequence admin_id
minvalue 1
maxvalue 99999
start with 1
increment by 1;
create sequence book_id
minvalue 1
maxvalue 99999
start with 1
increment by 1;
create sequence ub_id
minvalue 1
maxvalue 99999
start with 1
increment by 1;
没有人你那个解答一下吗
建立了一个数据库,创建序列名字为 users_id
最小值为1,最大值为99999
开始值为1,每次增量1,
创建序列名字为 admin_id
最小值为1,最大值为99999
开始值为1,每次增量1。。。。。。。。。以下同上
第一句话是取当前系统时间与2002年4月5日的差值
下面是的创建从1到99999正常因子是1的序列 oracle没有自增长因子需要通过序列去实现
select floor(sysdate - to_date('20020405','yyyymmdd')) from dual; 从dual表里面选取当前日期和2002年0405的差值,再取整
create sequence users_id 创建序列users_id
minvalue 1 最小值1
maxvalue 99999 最大99999
start with 1 从1开始
increment by 1; 每次增加1
create sequence admin_id 创建序列admin_id
minvalue 1 最小1
maxvalue 99999 最大 99999
start with 1 从1开始
increment by 1; 每次增加1
create sequence book_id 创建序列book_id
minvalue 1 最小1
maxvalue 99999 最大99999
start with 1 从1开始
increment by 1; 每次增加1
create sequence ub_id 创建序列 ub_id
minvalue 1 最小1
maxvalue 99999 最大99999
start with 1 从1开始
increment by 1; 每次增加1
没有创建对应的序列,或者序列名有问题