select *
from
(select Col1,Col2,Value from Result) as t1
Col1 | Col2| Value
a 5 1a 4 -1
b 5 3
b 4 4
c 5 1
c 4 -1
a 5 1
a 6 1
select *
from
(select Col1,Col2,Value from Result) as t1
pivot( avg(Value) for [Col1] in (a,b,c,d) )as t2
Col1 a b c d
4 -1 4 -1 NULL
5 1 31NULL
6 1 NULLNULLNULL