Skip
Arish's avatar

144. IFNULL Function


IFNULL Function

Replace NULL with a default value.

sql
1SELECT name, IFNULL(phone, 'No Phone') AS phone
2FROM students;

If phone is NULL, shows 'No Phone'.