Home  >  Article  >  Database  >  How is the MySQL NULLIF() control flow function similar to the CASE statement?

How is the MySQL NULLIF() control flow function similar to the CASE statement?

王林
王林forward
2023-09-14 12:53:091041browse

MySQL NULLIF() 控制流函数与 CASE 语句有何相似之处?

As we know, MySQL's NULLIF() control flow function returns NULL when the two parameters are the same, otherwise it returns the first parameter. Therefore, it is similar to the following CASE statement:

CASE
WHEN expression1=expression2 THEN NULL
ELSE
Expression2
END.

The above is the detailed content of How is the MySQL NULLIF() control flow function similar to the CASE statement?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete