The MySQL CHAR() function ignores NULL if NULL is provided as a parameter. To understand it, consider the following example -
mysql> Select CHAR(65,66,67,NULL); +---------------------+ | CHAR(65,66,67,NULL) | +---------------------+ | ABC | +---------------------+ 1 row in set (0.00 sec) mysql> Select CHAR(NULL,66,67,NULL); +-----------------------+ | CHAR(NULL,66,67,NULL) | +-----------------------+ | BC | +-----------------------+ 1 row in set (0.00 sec)
In both the above examples, the CHAR() function ignores NULL and converts the numeric value to a character value.
The above is the detailed content of What happens if we provide NULL as a parameter to the MySQL CHAR() function?. For more information, please follow other related articles on the PHP Chinese website!