We know that the MySQL NULLIF() control flow function will return the first parameter, and the two parameters are not the same. Returns the first argument because MySQL evaluates the first argument twice if the two arguments are not the same.
mysql> Select NULLIF('Tutorialspoint','MySQL'); +----------------------------------+ | NULLIF('Tutorialspoint','MySQL') | +----------------------------------+ | Tutorialspoint | +----------------------------------+ 1 row in set (0.00 sec)
In the above example, since the parameters are not the same, MySQL evaluates the first parameter, i.e. "Tutorialspoint", twice and returns it as output.
The above is the detailed content of How does MySQL evaluate an expression if the parameters in NULLIF() are not equal?. For more information, please follow other related articles on the PHP Chinese website!