question

sand143eep avatar image
sand143eep asked

tsql to get the columns in to rows

Hello i have the table as shown below: id product version 23 telenor v1 23 uninor v2 now i need the output format as: id product1 product2 version1 version2 23 telenor uninor v1 v2 can any one help with the tsql statement.
sql-server-2008sql-server-2005
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image ThomasRushton ♦♦ commented ·
0 Likes 0 ·
sunil2711 avatar image
sunil2711 answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

teddy avatar image
teddy answered
You can reference above opinion. If your output is fixed,then you can use cursor to solve.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jeff Moden avatar image Jeff Moden commented ·
You just don't need a cursor to do this.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.