Hello,
I have a table that looks like:
CREATE TABLE [dbo].[SKRS_OriginalData](
.........
[Atgard1] [int] NULL,
[Atgard2] [int] NULL,
[Atgard3] [int] NULL,
[Atgard4] [int] NULL,
[Atgard5] [int] NULL,
[Atgard6] [int] NULL,
[Atgard7] [int] NULL,
[Atgard8] [int] NULL,
[Atgard9] [int] NULL,
[Atgard10] [int] NULL,
........
)
Select all Open in new window
I want to extract all the rows and create a result that lists all the values in columns Atgard1 to Atgard10 as a single column called Atgard.
So
1,2,3,4,5,,,,,,
6,7,8,,,,,,,,
9,,,,,,,,,,
should become
1,
2,
3,
4,
5,
6,
7,
8,
9,
Select all Open in new window
All the nulls should be excluded.
Is this some type of unpivot?
Open in new window