October 15, 2008 at 2:50 pm
I have a 1 row table that looks like this:
FirstName MiddleName LastName
--------- ----------- ---------
Robert Ewing Jones
I want to rotate it so it looks like this where the column headers become the values in the left column
Name Value
----- ------
FirstName Robert
MiddleName Ewing
LastName Jones
if it helps, I'm doing this so I can present some data in a more logical fashion in SSRS.
Thanks,
Chris
October 15, 2008 at 2:56 pm
Look up the UNPIVOT command in books online. I think it should do exactly what you're after.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 17, 2008 at 9:10 am
I had to look at it and walk away 3 times before I finally got it, but that was exactly what I needed!
Thank you,
Chris
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply