Coalesce() function on databricks

Viewed 422

I want to replace null values from a column to 0 using coalesce() function instead of isNULL(). Can anyone tell me how ?

1 Answers

You need to use nvl function instead (see docs), like this:

select nvl(column, 0) as column from ...

Or coalesce itself (but for me nvl is more natural:

select coalesce(column, 0) as column from ...
Related