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, 1108🔥, 0💬
Popular Posts:
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...
How To Verify a User name with SQLCMD Tool in SQL Server? The quickest way to verify a user name in ...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
How To Start Instance with a Minimal Initialization Parameter File in Oracle? The sample initializat...
How To Get Year, Month and Day Out of DATETIME Values in SQL Server Transact-SQL? You can use DATEPA...