If you use concat functions in Snowflake, if there any of
the column is having a NULL value, it returns the value as NULL.
To avoid that, we can use array_construct and
array_to_string as below:
select array_to_string(array_construct([column1], [column2],
[column3]),'|')
If the values for Column1 = 'abc', Column2=NULL, Column3
='xyz', then the above query return the output as 'abc||xyz'
No comments:
Post a Comment