Zum Inhalt springen

Gibt den ersten Ausdruck zurück, wenn er nicht NULL ist, andernfalls den zweiten Ausdruck.

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 │
└─────────┴──────────┘