Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • LENGTH(str) MySQL function

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 257
    Comment on it

    LENGTH(str)

    LENGTH(str) mysql function returns the length of the string str, measured in bytes. This function counts a multibyte character as multiple bytes. hence it means for a string containing 4(four) 2-byte characters then LENGTH() returns 8, whereas CHAR_LENGTH() returns 5.

    Here is some example which will explain you clearly-

    mysql> SELECT LENGTH('Hello MySQL');
    +-----------------------+
    | LENGTH('Hello MySQL') |
    +-----------------------+
    |                    11 |
    +-----------------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT LENGTH('123');
    +---------------+
    | LENGTH('123') |
    +---------------+
    |             3 |
    +---------------+
    1 row in set (0.00 sec)
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: