
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
What happens if we provide NULL as an argument to MySQL CHAR() function?
MySQL CHAR() function will ignore NULL if it is provided as an argument to it. To understand it, consider the following examples −
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 examples above, CHAR() function ignores the NULL and converts the numeric value into character value.
- Related Articles
- What MySQL returns if we provide value larger than 255 as argument to MySQL CHAR() function?
- What happens if a NULL argument is provided in MySQL CONV() function?
- What MySQL returns if I provide a non-hexadecimal number as an argument to UNHEX() function?
- What MySQL ASCII() function returns if I will provide NULL to it?
- What will MySQL CHAR_LENGTH() function return if I provide NULL to it?
- What MySQL returns if we use NULL, as both the arguments, as one of the argument and as a separator, in CONCAT_WS() function?
- What MySQL returns if the argument of QUOTE() function is NULL?
- What MySQL returns if we include time components along with date component as an argument to DATEDIFF() function?
- What MySQL returns if we include date components along with time component as an argument to TIMEDIFF() function?
- What happens if I pass only one argument to the MySQL CONCAT() function?
- What MySQL returns if the list of strings, provided as argument in FIELD() function, are NULL?
- What MySQL EXPORT_SET() function returns if any of the argument is NULL?
- What MySQL returns if the first argument of INTERVAL() function is NULL?
- How MySQL SUBSTRING_INDEX() function returns the substring if we provide the negative value of the argument ‘count’?
- What MySQL COALESCE() function returns if it has a blank, but not NULL, as the first argument?

Advertisements