Oracle 生成不重复ID
本人使用方法2可用,方法1供参考
方法1:
sys_guid()
select sys_guid() from dual
方法2:
lower(rawtohex(sys_guid()))
select lower(rawtohex(sys_guid())) from dual
实例:
insert into 表A (id,name....) values (sys_guid(),name....)
insert into 表B (id,name....) values (lower(rawtohex(sys_guid())),name....)