Skip to content
Advertisement

SQL – Remove Blanks/nulls rows and combine rows

I want to combine multiple rows into as few rows as possible by removing nulls

Current: Table1 CurrentTable

want: Table2: WantTable

Advertisement

Answer

For your sample data and results you can use:

select column1, column2, min(column3), min(column4), . . .,
       column8
from t
group by column1, column2, column8;
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement