Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ammyhus
Starting Member
8 Posts |
Posted - 2012-01-17 : 07:04:39
|
| hi every one i am trying to convert rows into coulmns would want to know what code to use to achive the same. i want to convert this .MDC1201500100;1 023913600018 BOEMARA1MDC1201500100;1 023913600018 BOEMARA2MDC1201500100;1 023913600018 BOEMARA3MDC1201500100;1 023913600018 BOEMARA4into MDC1201500100;1 023913600018 BOEMARA1,BOEMARA2,BOEMARA3,BOEMARA4thanks in advance. |
|
|
ammyhus
Starting Member
8 Posts |
Posted - 2012-01-17 : 07:06:31
|
| sorry i forgot to mention but the final out put has to be in 3 coulmns only. Thanks & Regards |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-01-17 : 07:10:35
|
| You should be able to use the PIVOT operator. There is documentation and examples here: http://msdn.microsoft.com/en-us/library/ms177410.aspx |
 |
|
|
ammyhus
Starting Member
8 Posts |
Posted - 2012-01-17 : 23:14:01
|
| but doesnt pivot need the values of the measure column. i would appriciate if you could show me how the same would be achived if my measure is an account number feild. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
|
|
|
|
|