??????????????????????????ù???mysql??????????????????oracle??????е??oh??no
???????????12c?汾????????????????????????????????????У?????????????id?????????????
create table t
(
id ???? ????  number generated by default as identity (start with 1 increment by 1)??
name ????   varchar2(20)??
password????varchar2(20)??
Constraint Pk_T Primary Key ( Id )
);
?????????????????????11g???????????????+??????????????
??????????
-create table t
(
id ???? ????  number??
name ????   varchar2(20)??
password????varchar2(20)??
Constraint Pk_T Primary Key ( Id )
);
CREATE SEQUENCE seq_t----------------/*????????*/
INCREMENT BY 1 ----------------/*????1*/
START WITH 1 ----------------/*??1???*/
NOMAXVALUE ----------------/*??д??*/
NOCYCLE
NOCACHE;
CREATE TRIGGER tri_t  BEFORE------------------/*??????????*/
INSERT ON t  FOR EACH ROW WHEN (new.id is null)
begin
select seq_t.nextval into: new.id from dual;
end;