TO_CHAR(character)
Description
This function converts character data to a VARCHAR string.
Syntax
TO_CHAR(character)
Parameters
character: the character data to convert.
Return Type
- Returns data of the
VARCHARtype. - Returns
NULLif thecharactervalue isNULL.
Examples
SELECT TO_CHAR('Hello, World!'), TO_CHAR(NULL);
The return result is as follows:
+--------------------------+---------------+
| TO_CHAR('Hello, World!') | TO_CHAR(NULL) |
+--------------------------+---------------+
| Hello, World! | NULL |
+--------------------------+---------------+
1 row in set (0.001 sec)