Isnull equivalent in mysql?

MySQL NULL function to handle NULL values.
MySQL IFNULL function is one of the MySQL control flow functions that accepts two arguments and returns the first argument if it is not NULL.
Otherwise, the IFNULL function returns the second argument.

Syntax

select IFNULL(expression_1,expression_2);

Examples
SELECT IFNULL(USERNAME,'GUEST') FROM USERTABLE WHERE USERID IS NULL
Examples 1:
SELECT IFNULL(1,0); 
Examples 2:
SELECT IFNULL('',1); 

Post a Comment

0 Comments