Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • CONCAT string function mysql

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 470
    Comment on it

    CONCAT(str1,str2,...)

    CONCAT() string function in mysql returns the string that results from concatenating the all input arguments.
    CONCAT may have one or more arguments. If all arguments are nonbinary strings then their result will be a nonbinary string and If the arguments include any binary strings then the result will be a binary string. A numeric argument is converted to its equivalent nonbinary string form. if any argument is NULL then CONCAT returns NULL.

    mysql> select concat('hello','world');
    +-------------------------+
    | concat('hello','world') |
    +-------------------------+
    | helloworld              |
    +-------------------------+
    1 row in set (0.00 sec)
    
    mysql> select concat('hello',' ','world');
    +-----------------------------+
    | concat('hello',' ','world') |
    +-----------------------------+
    | hello world                 |
    +-----------------------------+
    1 row in set (0.00 sec)
    
    mysql> select concat('hello','','world');
    +----------------------------+
    | concat('hello','','world') |
    +----------------------------+
    | helloworld                 |
    +----------------------------+
    1 row in set (0.00 sec)
    
    mysql> select concat('hello',NULL,'world');
    +------------------------------+
    | concat('hello',NULL,'world') |
    +------------------------------+
    | NULL                         |
    +------------------------------+
    1 row in set (0.03 sec)
    
    mysql> select concat('17','.3');
    +-------------------+
    | concat('17','.3') |
    +-------------------+
    | 17.3              |
    +-------------------+
    1 row in set (0.00 sec)
    
    mysql> select concat('17','0.3');
    +--------------------+
    | concat('17','0.3') |
    +--------------------+
    | 170.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: