'How to replace NULL to specific string in snowflake (SQL)

Does anyone know how to replace NULL to specific string in snowflake (SQL)?

Before

ID Name
1 Apple
2 NULL
3 NULL

After

ID Name
1 Apple
2 Not Defined
3 Not Defined

I would like to replace NULL with Not Defined.

Sincerely,

knozawa



Solution 1:[1]

NULL value could be replaced using the following functions: IFNULL/NVL/COALESCE:

SELECT ID, COALESCE(Name, 'Not Defined) AS Name
FROM tab

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1