• CONVERT( expr  USING transcoding_name ) , CONVERT( expr , type ) 

The CONVERT()  function takes an expression of any type and produces a result value of the specified type. 

CONVERT(... USING ...)  is standard SQL syntax. The non- USING  form of CONVERT()  is ODBC syntax. 

CONVERT( expr  USING transcoding_name )  converts data between different character sets. In MySQL, transcoding names are the same as the corresponding character set names. For example, this statement converts the string ’abc’  in the default character set to the corresponding string in the utf8mb4  character set: 

SELECT CONVERT(’abc’ USING utf8mb4); 

CONVERT( expr , type )  syntax (without USING ) takes an expression and a type  value specifying the result type. This operation may also be expressed as CAST( expr  AS type ) , which is equivalent. These type  values are permitted: 

• BINARY[( N )] 

Produces a string with the BINARY  data type. For a description of how this affects comparisons, see Section 11.3.3, “The BINARY and VARBINARY Types” . If the optional length N  is given, BINARY( N ) 

