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

标签: default, string, return, str, random, sql, end, varchar, 62

相关文章推荐

添加新评论,含*的栏目为必填