我是希望能在定义的时候实现,比如: create table a( col varchar(15) default (这里希望能自动排序的字段) ) 该怎么实现啊?
自动加1字段建立?create table a(b int, cvarchar2(5));建一个序列create sequence a_seq increment by 1 start with 100;建一个触发器create or replace trigger t_abefore insert on afor each rowbeginselect s_a.nextval into :new.b from dual;end;
wylwyl1130(落雪山林)写的很清楚了. insert into table values(to_char(sysdate,'yyyy')||'-'||lpad(test_seq.nextval,4,'0'));
create table a(
col varchar(15) default (这里希望能自动排序的字段)
)
该怎么实现啊?
insert into table values(to_char(sysdate,'yyyy')||'-'||lpad(test_seq.nextval,4,'0'));