Link to home
Start Free TrialLog in
Avatar of Swadhin Ray
Swadhin RayFlag for United States of America

asked on

SQL query

Hello Experts ,

I have a table test , which has values as like below:

select * from test;

col1 col2 
1	AA
2	BB

Open in new window


Now I want  to get the result as below on SQL Server 2008 version without using pivot:

column_name  data1 data2        
col1 1  2
col2 AA BB

Open in new window

Avatar of Jared_S
Jared_S

SQL wont support that in any way that is even moderately efficient. Can you process the data outside of SQL?
ASKER CERTIFIED SOLUTION
Avatar of Lee Wadwell
Lee Wadwell
Flag of Australia 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
I wonder also about such a requirement, and can confirm that with "sql", you cannot do this.

in ms excel, it would be a "transpose" function ...
Avatar of Swadhin Ray

ASKER

thanks