成都公司:成都市成华区建设南路160号1层9号
重庆公司:重庆市江北区红旗河沟华创商务大厦18楼
oracle 字段递增 表插入数据,id自动增1
1、创建表
create table test(id int, name varchar(32)) 2、创建序列 create sequence TID_seq minvalue 1 maxvalue 999999 start with 1 increment by 1 cache 20 ; 3、创建触发器 create or replace trigger test_tri before insert on test for each row begin select to_char(TID_seq.nextval) into :new.id from dual; end test_tri; 4、插入数据 insert into test(name) values ('a') insert into test(name) values ('b') select * from test
本文内容来自自互联网公开信息或用户自发贡献,该文观点仅代表作者本人,版权归原作者所有。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。若发现侵权或违规内容请联系电话4008352114或邮箱442699841@qq.com,核实后本网站将在24小时内删除侵权内容。

