韩小蚊,师傅美色可餐,心情不好的说说
db2
create table t1
(
id integer not null generated always as identity (start with 1 increment by 1 minvalue 1 no maxvalue no cycle no cache order ),
...
);
oracle(需要创建一个sequence和一个trigger):
create table t1
(
id number(10,0) not null,
...
);
create sequence t1_id_seq increment by 1 start with 1 nomaxvalue nocycle cache 100 order;
create or replace trigger insert_t1_id
before insert on t1
referencing new as new old as old
for each row
begin
select t1_id_seq.nextval into :new.id from dual;
end;
mysql
create table t1
(
id int not null auto_increment,
...
);
postgresql
create table t1
(
id serial not null,
...
);
sql server
create table t1
(
id int not null identity,
...
);
sybase
create table t1
(
id int not null identity,
...
);
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
相关文章:
-
-
-
快速向表插入大量数据
当需要对一个非常大的表INSERT的时候,会消耗非常多的资源,因为update表的时候,oracle需要生成 redo log和undo log;此时最...
[阅读全文]
-
-
-
Oracle入门学习五
学习视频: https://www.bilibili.com/video/BV1tJ411r7EC?p=55 数据的完整性:保证插入表格的数据必须正确。...
[阅读全文]
-
Oracle入门学习六
事务:把一组操作看做一个工作单元,要么都执行,要么都不执行。dml操作才有事务,查询没有事务。 开始事务:从上一次的事务结束之后,从第一次dml操作,就...
[阅读全文]
-
-
-
Oracle入门学习一
oracle的安装,用户授权,表格操作,数据类型,ddl表格,dml数据。 下一篇:Oracle入门学习二 学习视频:https://www.bilib...
[阅读全文]
-
Oracle入门学习二
上一篇:Oracle入门学习一 学习视频:https://www.bilibili.com/video/BV1tJ411r7EC?p=15 算术运算符:...
[阅读全文]
网友评论