I have the following query :
- SELECT Custid, Shipperid, Freight
- FROM Sales.FreightTotals
- UNPIVOT( Freight FOR Shipperid IN([1],[2],[3]) ) AS U;
I have the following result :
custid shipperid freight
1 1 98
1 3 55
2 2 75
This is my expected output :
custid shipperid freight
1 1 98
1 2 NULL
1 3 55
2 1 NULL
2 2 75
2 3 NULL