Aller au contenu

Renvoie la première expression si elle n’est pas NULL, sinon renvoie la seconde 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 │
└─────────┴──────────┘