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

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 235
    Comment on it

    LEFT(str,len)

    The LEFT mysql function returns the leftmost len characters from the string str or returns NULL if any argument is NULL. The LEFT function is multibyte safe.

    Here are some example which will explain you this function-

    mysql> SELECT LEFT('HELLO MYSQL WORLD',5);
    +-----------------------------+
    | LEFT('HELLO MYSQL WORLD',5) |
    +-----------------------------+
    | HELLO                       |
    +-----------------------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT LEFT('HELLO MYSQL WORLD',-1);
    +------------------------------+
    | LEFT('HELLO MYSQL WORLD',-1) |
    +------------------------------+
    |                              |
    +------------------------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT LEFT('HELLO MYSQL WORLD',10);
    +------------------------------+
    | LEFT('HELLO MYSQL WORLD',10) |
    +------------------------------+
    | HELLO MYSQ                   |
    +------------------------------+
    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: