* ランダムな文字列の生成 [#y75528ce]
** SUBSTRING('abc,,789',) [#m111527c]
SELECT CONCAT(
SUBSTRING('abcdefghijklmnopqrstuvwxyz0123456789', CEIL(RAND() * 36), 1),
SUBSTRING('abcdefghijklmnopqrstuvwxyz0123456789', CEIL(RAND() * 36), 1),
SUBSTRING('abcdefghijklmnopqrstuvwxyz0123456789', CEIL(RAND() * 36), 1),
SUBSTRING('abcdefghijklmnopqrstuvwxyz0123456789', CEIL(RAND() * 36), 1)
) AS random_string ;
);
** MD5() [#jd0b4b10]
SELECT SUBSTRING(MD5(RAND()), 1, 4) AS random_string;
SELECT SUBSTRING(MD5(RAND()), 1, 4);
MD5()は32桁の16進数を返す。https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_md5
** UUID() [#h4afbbdd]
SELECT UUID();
http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html#function_uuid