|
tm
Posting Yak Master
137 Posts |
Posted - 01/29/2013 : 14:02:36
|
Below is script to Unpivot the first table and it gives the result as you mentioned..
declare @t table ([Queue] varchar(30) , ACA varchar(10), BCR varchar(10))
insert into @t select 'Needs Review' ,'Rob' , 'Ben' union select 'Bundling' , 'Jay' , 'Jen'
--Unpivot the table. SELECT [Queue], Client, Employee FROM (SELECT [Queue], ACA, BCR FROM @t) AS p UNPIVOT (Employee FOR Client IN (ACA, BCR) )AS unpvt
Result:
Queue Client Employee Needs Review ACA Rob Needs Review BCR Ben Bundling ACA Jay Bundling BCR Jen |
 |
|