Collections:
IFNULL() - Replacing NULL Value
How to substitute a NULL value with a replacement value using the IFNULL() function?
✍: FYIcenter.com
IFNULL(val1, val2) is a MySQL built-in function that
returns the second argument if the first argument is NULL, the first
argument otherwise.
For example:
SELECT IFNULL(NULL, 'replacement'), IFNULL('original', 'replacement');
-- +-----------------------------+-----------------------------------+
-- | IFNULL(NULL, 'replacement') | IFNULL('original', 'replacement') |
-- +-----------------------------+-----------------------------------+
-- | replacement | original |
-- +-----------------------------+-----------------------------------+
Reference information of the IFNULL() function:
IFNULL(val1, val2): val Returns the second argument if the first argument is NULL, the first argument otherwise. Arguments, return value and availability: val1, val2: Required. The values to be selected from. val: Return value. The selected value. Available since MySQL 4.0.
⇒ INET_ATON() - IP Address String to Number
⇐ IF() - Conditional Value Selection
2023-12-19, 1140🔥, 0💬
Popular Posts:
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...
Where to find answers to frequently asked questions on PHP Connections and Query Execution for MySQL...
How To Change the Name of a Database User in SQL Server? If you want to change the name of an existi...
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into...
Where to find answers to frequently asked questions on Downloading and Installing SQL Server 2005 Ex...