Skip to content

Returns the first expression if it is not NULL, otherwise returns the second expression.

func.ifnull(get_column(table, 'phone'), 'N/A')
func.ifnull(get_column(table, 'phone'), 'N/A')
IFNULL(<phone>, 'N/A')
SELECT name, IFNULL(phone, 'N/A') AS phone FROM contacts;
┌─────────┬──────────┐
name │ phone │
├─────────┼──────────┤
│ Alice │ 555-1234
│ Bob │ N/A │
└─────────┴──────────┘