pivot

0

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

declare @T table
(
  EmpId char(3),
  X int,
  Y int
)

insert into @T
select 'U27', 1, 1 union all
select 'U28', 1, 2 union all
select 'U29', 1, 3 union all
select 'U30', 2, 1 union all
select 'U31', 2, 2 union all
select 'U32', 2, 3 union all
select 'U33', 3, 1 union all
select 'U34', 3, 2 union all
select 'U35', 3, 3

select [1], [2], [3]
from @T
pivot (min(EmpId) for Y in ([1], [2], [3])) as p

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results