Collections:
NULLIF() - NULL on Equal Values
How to generate NULL with equal values using the NULLIF() function?
✍: FYIcenter.com
NULLIF(val1, val2) is a MySQL built-in function that
returns NULL if the first argument equals the second,
the first argument otherwise.
For example:
SELECT NULLIF('yes', 'yes'), NULLIF('yes', 'no');
-- +----------------------+---------------------+
-- | NULLIF('yes', 'yes') | NULLIF('yes', 'no') |
-- +----------------------+---------------------+
-- | NULL | yes |
-- +----------------------+---------------------+
Reference information of the NULLIF() function:
NULLIF(val1, val2): val Returns NULL if the first argument equals the second, the first argument otherwise. Arguments, return value and availability: val1, val2: Required. The values to be selected from. val: Return value. NULL if val1=val2, val1 otherwise. Available since MySQL 4.0.
⇒ RELEASE_ALL_LOCKS() - Release All Locks
⇐ NAME_CONST() - PS Thread ID of Given Connect
2023-12-19, 1019🔥, 0💬
Popular Posts:
How To View Data Files in the Current Database in Oracle? If you want to get a list of all tablespac...
What Are Bitwise Operations in SQL Server Transact-SQL? Bitwise operations are binary operations per...
Can Binary Strings Be Converted into NUMERIC or FLOAT Data Types in SQL Server Transact-SQL? Can bin...
How To End a Stored Procedure Properly in SQL Server Transact-SQL? Where the end of the "CREATE PROC...
Where to find answers to frequently asked questions on PHP Connections and Query Execution for MySQL...