mysql、excel生成uuid格式总结
Mysql1、生成 有 - 的格式: e3d7387a-c1df-11ec-ac0a-525400625d29select UUID() as uuid2.生成不含 - 的格式:1dd13e56c1e011ecac0a525400625d29select replace(uuid(),"-","") as uuid;3.insert 使用INSERT INTO t_table (`id`,`nam
·
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)))
更多推荐
已为社区贡献1条内容
所有评论(0)