Syntax:
CONVERT(expr,type), CONVERT(expr USING transcoding_name)

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

Discussion of CONVERT(expr, type) syntax here also applies to CAST(expr
AS type), which is equivalent.

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

CONVERT() with USING 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 utf8 character
set:

SELECT CONVERT('abc' USING utf8);

CONVERT() without USING and CAST() take an expression and a type value
specifying the result type. These type values are permitted:

o BINARY[(N)]

  Produces a string with the BINARY data type. For a description of how
  this affects comparisons, see
  https://dev.mysql.com/doc/refman/5.7/en/binary-varbinary.html. If the
  optional length N is given, BINARY(N) causes the cast to use no more
  than N bytes of the argument. Values shorter than N bytes are padded
  with 0x00 bytes to a length of N.

o CHAR[(N)] [charset_info]

  Produces a string with the CHAR data type. If the optional length N
  is given, CHAR(N) causes the cast to use no more than N characters of
  the argument. No padding occurs for values shorter than N characters.

  With no charset_info clause, CHAR produces a string with the default
  character set. To specify the character set explicitly, these
  charset_info values are permitted:

  o CHARACTER SET charset_name: Produces a string with the given
    character set.

  o ASCII: Shorthand for CHARACTER SET latin1.

  o UNICODE: Shorthand for CHARACTER SET ucs2.

  In all cases, the string has the character set default collation.

o DATE

  Produces a DATE value.

o DATETIME

  Produces a DATETIME value.

o DECIMAL[(M[,D])]

  Produces a DECIMAL value. If the optional M and D values are given,
  they specify the maximum number of digits (the precision) and the
  number of digits following the decimal point (the scale).

o JSON

  Produces a JSON value. For details on the rules for conversion of
  values between JSON and other types, see
  https://dev.mysql.com/doc/refman/5.7/en/json.html#json-comparison.

o NCHAR[(N)]

  Like CHAR, but produces a string with the national character set. See
  https://dev.mysql.com/doc/refman/5.7/en/charset-national.html.

  Unlike CHAR, NCHAR does not permit trailing character set information
  to be specified.

o SIGNED [INTEGER]

  Produces a signed integer value.

o TIME

  Produces a TIME value.

o UNSIGNED [INTEGER]

  Produces an unsigned integer value.

URL: https://dev.mysql.com/doc/refman/5.7/en/cast-functions.html

