`
wangdf_jee
  • 浏览: 110911 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

关系数据库主键

阅读更多
(1)    MySQL       auto_increment

ID int auto_increment primary  key not null

(2)MS SQL Server  identity

ID int identity(1,1) primary key not null

(3)Oracle  Sequence

create sequence  CUSTOMERS_ID_SEQ increment by 2 start with 1

curval  返回序列的当前值。

nextval  先增加序列的值,然后返回序列值。

create table CUSTOMERS(ID int primary key not null,.....)

insert into CUSTOMERS values(CUSTOMERS_ID_SEQ.curval,'Tom',.....)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics