发两遍呀, select to_char(seq_id.nextval,'000') from dual,上个里写成user_sequences了
select to_char(seq_auto_strid.nextval,'000') from dual
是不可以直接创建这样的序列的。 可以这样替代 SELECT lpad((seq_auto_strid.nextval),3,0) FROM dual
create sequence seq_test start with 1 increment by 1 minvalue 1 maxvalue 999;select seq_test.nextval from dual;select to_char(seq_test.currval,'000') from dual;
create sequence abc minvalue 1 maxvalue 1000 start with 1 increment by 1 cache 10;
select to_char(seq_id.nextval,'000') from dual,上个里写成user_sequences了
select to_char(seq_auto_strid.nextval,'000') from dual
可以这样替代
SELECT lpad((seq_auto_strid.nextval),3,0)
FROM dual
start with 1
increment by 1
minvalue 1
maxvalue 999;select seq_test.nextval from dual;select to_char(seq_test.currval,'000') from dual;
minvalue 1
maxvalue 1000
start with 1
increment by 1
cache 10;