Mysql

1、生成 有 - 的格式: e3d7387a-c1df-11ec-ac0a-525400625d29

 select UUID() as uuid

在这里插入图片描述
2.生成不含 - 的格式:1dd13e56c1e011ecac0a525400625d29

select replace(uuid(),"-","") as uuid;

在这里插入图片描述
3.insert 使用

INSERT INTO t_table (`id`,`name`) VALUES (REPLACE(UUID(),"-",""),'张三');

Excel

1、Excel生成uuid 格式:600d65bc-948a-1260-2217-fd8dfeebb1cd

=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0,POWER(16,8)),8),"-",DEC2HEX(RANDBETWEEN(0,POWER(16,4)),4),"-","4",DEC2HEX(RANDBETWEEN(0,POWER(16,3)),3),"-",DEC2HEX(RANDBETWEEN(8,11)),DEC2HEX(RANDBETWEEN(0,POWER(16,3)),3),"-",DEC2HEX(RANDBETWEEN(0,POWER(16,8)),8),DEC2HEX(RANDBETWEEN(0,POWER(16,4)),4)))

2、Excel生成去除横杠uuid 格式:600d65bc948a12602217fd8dfeebb1cd

=LOWER(CONCATENATE(DEC2HEX(RANDBETWEEN(0,POWER(16,8)),8),"",DEC2HEX(RANDBETWEEN(0,POWER(16,4)),4),"","4",DEC2HEX(RANDBETWEEN(0,POWER(16,3)),3),"",DEC2HEX(RANDBETWEEN(8,11)),DEC2HEX(RANDBETWEEN(0,POWER(16,3)),3),"",DEC2HEX(RANDBETWEEN(0,POWER(16,8)),8),DEC2HEX(RANDBETWEEN(0,POWER(16,4)),4)))
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐