`

生成唯一id的方式

 
阅读更多

-----------------------------------------------------------------------


--生成id的方式
1,创建序列:

create sequence tmp_id increment by 1 start with 1 maxvalue 9999999 nocycle nocache; tmp_id.nextval

 

2,使用uuid:SYS_GUID();

example:

create table as select tmp_id.nextval as id,trunc(DBMS_RANDOM.VALUE(2,4))*100 NAME FROM ONE;

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics