IFNULL Function in MySQL

mysql-tutorials

If the value return null, we can set an value. If expression1 is null set as 0 otherwise expresssion 2

 

IFNULL( <FIELDNAME>, 0)

Example :-

select IFNULL(salary, 0) from employee table

The above example return ZERO value in case of null string in the column salary in employee table.

Related posts

Leave a Comment