sql random string

begin
declare chars_str varchar(62) default 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
declare return_str varchar(255) default '';
declare i int default 0;
while i<n do
set return_str=concat(return_str,substring(chars_str,floor(1+rand()*62),1));
set i=i+1;
end while;
return return_str;
end

上一篇:Centos7 - mysql 5.5.62 tar.gz 方式安装


下一篇:Leetcode 62.不同路径(Unique Paths)