简单高效的解决方案,可获得随机的10个字符的字符串,包括大小写字母和数字:
select substring(base64_encode(md5(rand())) from 1+rand()*4 for 10);