Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
my T-sql query results two columns with n rows i need to display them as n columns with 2 rows i tried with pivot and rownumber() but unable to get the result can any one help me please.

My result:

idname
112 a
1212 b
1432 d
56756 hhh
97543 sssx
. .
. .
. .


Required o/p:
112 1212 1432 56756 97543 .. ..
a b d hhh sssx .. ..
Posted
Updated 20-Oct-15 6:17am
v3
Comments
Suvendu Shekhar Giri 20-Oct-15 11:49am    
Required o/p ?
What is required o/p?
Member 11183138 20-Oct-15 11:53am    
required o/p:
112 1212 1432 56756 97543 . . . .
a b d hhh sssx . . . .

1 solution

Please, read this: Dynamic PIVOT in Sql Server[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900