时间:2021-07-01 10:21:17 帮助过:1人阅读
begin
select example_sequence.nextval into: new.id from dual;
end;
测试一下,插入数据
insert into example(name) values(‘张三‘);
insert into example(id, name) values(111,‘李四‘);
输入查询语句:
select t.* from EXAMPLE t
结果是:
id | name |
1 | 张三 |
111 | 李四 |
Oracle自增ID实现
标签: