Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2013-03-11 : 09:14:52
|
Hi All,Furniture Retail Module 1 Furniture Retail Module 2Passed PassedFailed PassedHow to display above data in following mannerModuleName ResultFurniture Retail Module 1 Passed Furniture Retail Module 1 FailedFurniture Retail Module 2 PassedFurniture Retail Module 2 PassedKindly please suggest me on this. Vijay is here to learn something from you guys. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-11 : 12:49:20
|
[code]declare @test table([Furniture Retail Module 1] varchar(100),[Furniture Retail Module 2] varchar(100))insert @testSELECT 'Passed','Passed' UNION ALLSELECT 'Failed','Passed'SELECT ModuleName,ResultFROM @test tUNPIVOT ( Result FOR ModuleName IN ([Furniture Retail Module 1],[Furniture Retail Module 2]))uORDER BY ModuleNameoutput-----------------------------------------------------------ModuleName Result-----------------------------------------------------------Furniture Retail Module 1 PassedFurniture Retail Module 1 FailedFurniture Retail Module 2 PassedFurniture Retail Module 2 Passed[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
vijays3
Constraint Violating Yak Guru
354 Posts |
Posted - 2013-03-12 : 05:08:17
|
Thanks Visakh..Vijay is here to learn something from you guys. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-03-12 : 05:13:45
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|