I have a dataset that needs to be grouped by/ washed?There is 300 000 rows that i want to group by / Erase all NULL values and minimize the amount of rows.
The problem seems to be my Textcolumns.
Key Field TextGER TextDen TextSPA
33220 Field1 SPACECARROT NULL NULL
33220 Field1 NULL NULL SPACECARROT
33220 Field1 NULL SPACECARROT NULL
33220 Field1 SPACE carrot SPACE carrot SPACE carrot
Happy for good answers and solutions!
select Key, Field, Max(TextGer) as TextGer, Max(TextDen) as TextDen, max(TextSpa) as TextSpa from myTable
group by Key, Field
If the text fields are test, first cast them to varchar(max).
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.
Would you like to participate?