select
length('abcdefg') english,
length('가나다라마바사') korean
from dual
This returns below.
english korean
7 21
Is there any function returning the count of character not character bytes?
I mean what I need is
english korean
7 7
use :
CHAR_LENGTH()
(the number of characters)
reference :
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_char-length
See the manual:
Returns 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 CHAR_LENGTH() returns 5.
CHAR_LENGTH()
will do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With