本文介绍了生成新的唯一字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我想生成一个由8个字符和数字组成的唯一字符串,我可以插入
此字符串作为主键,不再重复
如果选择的话,主键应始终为数字类型(并使其自动递增).如果仍然可以解决此问题,请执行此操作.
可以在此处(可能是最好的) [ ^ ],此处 [ ^ ],此处 [ ^ ],可能还有更多此处 [ ^ ] ;)
实际上,第三个方法的最后一种方法是创建长度为8的字符串.
希望对您有所帮助!
hi I want to generate a unique string consists of 8 char and number which i can insert this string as a primary key not repeated thanks
解决方案 Primary Keys should always be a numeric type (and make it auto-increment) if you have a choice. If you can still fix this, do it. Some methods for creating unique strings can be found here (probably best)[^], here[^], here[^], and possibly some more here[^] ;) The last method of the third one actually kind of way off creates strings of exactly length 8. Hope it helps!更多推荐
生成新的唯一字符串
发布评论