Skip to content
Advertisement

How to update only first NULL column with a value in Snowflake sql?

How to update a table first Null column with value and other Null columns with the text ‘Available’?

My attempt: I tried using Case statements but it is affecting the performance of a query.

Is there any efficient way to update a table as mentioned below the expected format?

Expected Output:

Advertisement

Answer

Try using a combination of nvl2 and coalesce

enter image description here

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement