MySQL concat() function



Reference :-

http://www.w3resource.com/mysql/string-functions/mysql-concat-function.php



http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat
MySQL concat() function

Description
              MySQL CONCAT() function is used to add two
              or more strings. It will return non-binary
              strings when all the strings are non-binary and
              return binary string when any of the specified
              string is binary. A numeric argument is also
              converted in its equivalent binary string form.
              It can be avoided by using an explicit type CAST


Syntax

              CONCAT (string1, string2,…)
MySQL concat() function

Example of MySQL concat() function



 Code:-


SELECT CONCAT('Use',' MySQL');
MySQL concat() function

Example of MySQL concat() function on columns



Code:-


SELECT CONCAT(pub_city,'--> ',country)
FROM publisher;

Concat presentation

  • 1.
    MySQL concat() function Reference:- http://www.w3resource.com/mysql/string-functions/mysql-concat-function.php http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat
  • 2.
    MySQL concat() function Description MySQL CONCAT() function is used to add two or more strings. It will return non-binary strings when all the strings are non-binary and return binary string when any of the specified string is binary. A numeric argument is also converted in its equivalent binary string form. It can be avoided by using an explicit type CAST Syntax CONCAT (string1, string2,…)
  • 3.
    MySQL concat() function Exampleof MySQL concat() function Code:- SELECT CONCAT('Use',' MySQL');
  • 4.
    MySQL concat() function Exampleof MySQL concat() function on columns Code:- SELECT CONCAT(pub_city,'--> ',country) FROM publisher;