select
length('abcdefg') english,length('가나다라마바사') korean
from dual
这将返回以下.
english korean
7 21
是否有任何函数返回字符数而不是字符字节?
我的意思是我需要的是
english korean
7 7
最佳答案
见the manual:
原文链接:https://www.f2er.com/mysql/433158.htmlReturns the length of the string str,measured in bytes. A multi-byte character counts as multiple bytes. This means that for a string containing five 2-byte characters,LENGTH() returns 10,whereas 07001 returns 5.
CHAR_LENGTH()
会做你想要的.