我是一个学生
我做作业,做auto increment
如何auto increment
在 Oracle 中创建一个?
CREATE TABLE mua_thi
(
mamuathi varchar2(10) not null,
check(mamuathi like 'MT%')
)
mamuathi = MT + auto_increment;
create or replace trigger tangmuathi
before insert or update
on mua_thi
begin
set new.mamuathi := MT + muathitang.nextval from Dual;
end;
create sequence muathitang start
with 1 increment by 1;