 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the use of MySQL NULLIF() control flow function?
MySQL NULLIF() control flow function will return NULL if both the arguments are the same, otherwise, it returns the first argument.
Syntax
NULLIF(expression1, expression2)
Here if expression1 = expression2, NULL will be returned by NULLIF() otherwise expression1 will be returned. Following example will exhibit this −
mysql> Select NULLIF('Ram','Ram'); +---------------------+ | NULLIF('Ram','Ram') | +---------------------+ | NULL                | +---------------------+ 1 row in set (0.00 sec) mysql> Select NULLIF('Ram','Shyam'); +-----------------------+ | NULLIF('Ram','Shyam') | +-----------------------+ | Ram                   | +-----------------------+ 1 row in set (0.00 sec)Advertisements
 