Convert row to column using sql server 2008?

Posted by jaykanth on Stack Overflow See other posts from Stack Overflow or by jaykanth
Published on 2010-06-03T11:50:39Z Indexed on 2010/06/03 11:54 UTC
Read the original article Hit count: 276

Filed under:
|

Table name is Looupvalue

id Ptypefield Value 1 1 D 2 1 E 3 1 F 4 1 G 5 1 H 6 2 FL 7 2 IF 8 2 VVS1 9 2 VVS2 10 2 VS1 11 2 VS2 12 3 0.50 13 3 1.00 14 3 1.50 15 3 2.00 16 4 Marquise 17 4 Round 18 4 Pear 19 4 Radiant 20 4 Princess

Lookupvalue table value convert roow to column depends on ptypefield

Like id 1 id 2 id 3 id 4 1 D 6 fl 12 0.50 16 Marquise
2 E 7 If 13 1 17 Round....
3 F 8 vvs2 14 1.5 4 G 9 vvs2 15 2 5 H 10 vs1 11 vs2

Thanks

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2008