Link to home
Start Free TrialLog in
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

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

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Shiju S

ASKER

That helped. thanks a lot