Reputation:
I have a table with below columns:
Column1 | Column2 | Column3 |
---|---|---|
A | Hello | NULL |
A | NULL | WORLD |
I want the above table to transform like below:
Column1 | Column2 | Column3 |
---|---|---|
A | Hello | WORLD |
I'm using Snowflake DataWarehouse. Need help in the above transformation using SQL
Upvotes: 0
Views: 47
Reputation: 1499
select column1,
max(column2) as column2,
max(column3) as column3
from your_table
group by column1;
Upvotes: 1