您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Oracle 添加自增列

2025/9/21 17:43:48发布22次查看
因为这段时间做项目的时候,对方的数据库是oracle 的,做自增的时候不能像mssql一样 identity(1,1) 所以 看下面的代码。create s
因为这段时间做项目的时候,对方的数据库是oracle 的,,做自增的时候不能像mssql一样 identity(1,1) 所以 看下面的代码。
create sequence userid_sequence --创建 sequence 名为 userid_sequence
increment by 1  -- 每次自增1
start with 1  --从1 开始自增
nomaxvalue --没有最大值
nocycle --不循环
之后通过 userid_sequence.currval  访问当期 通过 userid_sequence.nextval 访问 下一个。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product