DB2实现类似sqlserver的newid()函数

select substr(lower(hex(rand())),1,8)||'-'||substr(lower(hex(rand())),9,4)||'-'||substr(lower(hex(rand())),13,4)||'-'||substr(lower(hex(rand())),1,4)||'-'||substr(lower(hex(rand())),5,12)
as uuid from sysibm.sysdummy1

你可能感兴趣的:(db2,数据库,sql,db2)