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, 1144🔥, 0💬
Popular Posts:
How to put statements into a statement block in SQL Server Transact-SQL? You can put statements into...
How To Convert Binary Strings into Hexadecimal Character Strings in SQL Server? When a query returns...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...
Where to find answers to frequently asked questions on CREATE, ALTER and DROP Statements in MySQL? H...