What is the use of MySQL CHAR() function?


In MySQL, is it possible to get the character value of the given integer value based on the ASCII table?

MySQL CHAR() function is used to return the character value of the given integer value according to the ASCII table. Its syntax is as follows −

Syntax

CHAR(N,…[USING charset_name])

Here N, are the integers whose characters' values are to be retrieved.

Example

mysql> Select CHAR(65,66,67,68);
+-------------------+
| CHAR(65,66,67,68) |
+-------------------+
| ABCD              |
+-------------------+
1 row in set (0.00 sec)

Updated on: 22-Jun-2020

229 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements