| Author |
Topic  |
|
|
ranjana
Starting Member
1 Posts |
Posted - 11/27/2012 : 13:02:02
|
Hi ,
I have two columns in a table that have value like
columnname(a,b,c,d) value(1,2,3,4)
now i need output like
columnname value a 1 b 2 c 3 d 4
please suggest need full. |
|
|
jimf
Flowing Fount of Yak Knowledge
USA
2868 Posts |
Posted - 11/27/2012 : 13:03:51
|
never mind, I misread your post! Jim
Everyday I learn something that somebody else already knew |
Edited by - jimf on 11/27/2012 13:05:06 |
 |
|
|
jimf
Flowing Fount of Yak Knowledge
USA
2868 Posts |
Posted - 11/27/2012 : 13:11:15
|
here we go
declare @table table( a int,b int,c int,d int)
insert into @table values(1,2,3,4) select * from (select a,b,c,d from yourTable )p UNPIVOT (value for columnName in (a,b,c,d) ) as unpvt
Jim
Everyday I learn something that somebody else already knew |
 |
|
| |
Topic  |
|
|
|