LENGTH() CHAR_LENGTH()

http://dev.mysql.com/doc/refman/5.7/en/string-functions.html#function_length

LENGTH(str)

Returns the length of the string str, measured in bytes. A multibyte character counts as multiple bytes. This means that for a string containing five 2-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.

CHAR_LENGTH(str)

Returns the length of the string str, measured in characters. A multibyte character counts as a single character. This means that for a string containing five 2-byte characters, LENGTH() returns 10, whereas CHAR_LENGTH() returns 5.

上一篇:如何整治那些敢偷用你Wi-Fi的人


下一篇:使用 GCD 实现倒计时效果