ランダムな文字列の生成SUBSTRING('abc,,789',)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) ); MD5()SELECT SUBSTRING(MD5(RAND()), 1, 4); MD5()は32桁の16進数を返す。https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_md5 UUID()SELECT UUID(); http://dev.mysql.com/doc/refman/5.6/en/miscellaneous-functions.html#function_uuid |
|