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, 1228🔥, 0💬
Popular Posts:
Where to find Oracle database server tutorials? Here is a collection of tutorials, tips and FAQs for...
How To Convert Binary Strings into Integers in SQL Server Transact-SQL? Binary strings and integers ...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
How To Set Up SQL*Plus Output Format in Oracle? If you want to practice SQL statements with SQL*Plus...
How To Convert Binary Strings into Integers in SQL Server Transact-SQL? Binary strings and integers ...