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
2026-10-24, 2009🔥, 0💬
Popular Posts:
What Are the Differences between BINARY and VARBINARY in MySQL? Both BINARY and VARBINARY are both b...
How To Look at the Current SQL*Plus System Settings in Oracle? If you want to see the current values...
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
How To Escape Special Characters in SQL statements in MySQL? There are a number of special character...
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...