CONVERT(... USING ...) 用于改变字符串的默认字符集
mysql> SELECT CHARSET(‘abc‘); # 默认是utf8字符集 +----------------+ | CHARSET(‘abc‘) | +----------------+ | utf8 | +----------------+ mysql> SELECT CHARSET(CONVERT(‘abc‘ USING latin1)); # 转换成latin1字符集 +--------------------------------------+ | CHARSET(CONVERT(‘abc‘ USING latin1)) | +--------------------------------------+ | latin1 | +--------------------------------------+
时间: 2024-10-28 01:44:22