Avatar of Shiju S
Shiju SFlag for United States of America

asked on 

Transposing result of a select statement

Hi,

I would like to get transpose of a select statement result.
Is there a way to do this in SQL Server

Col1   Col2   Col3
----   ----   ----
A      B      C
D      E      F
G      H      I   
 
Transpose result
Col1   Col2   Col3
----   ----   ----
A   D   G
B   E   H
C   F   I

Open in new window

Oracle DatabaseMicrosoft SQL Server 2005Microsoft SQL Server

Avatar of undefined
Last Comment
Shiju S
Avatar of awking00
awking00
Flag of United States of America image

Can you guarantee an equal number of rows and columns to begin with?
ASKER CERTIFIED SOLUTION
Avatar of David Todd
David Todd
Flag of New Zealand image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
SOLUTION
Avatar of ralmada
ralmada
Flag of Canada image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Shiju S
Shiju S
Flag of United States of America image

ASKER

That helped. thanks a lot
Microsoft SQL Server
Microsoft SQL Server

Microsoft SQL Server is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.SQL Server is available in multiple versions, typically identified by release year, and versions are subdivided into editions to distinguish between product functionality. Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning.

171K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo