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.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 transposing data

Author  Topic 

mdhingra01
Posting Yak Master

179 Posts

Posted - 2004-06-17 : 12:07:53
For example.

In a table I have 2 columns

Col A Col B
AAA 1
AAA 3
AAA 2
BBB 2
BBB 3
BBB 5

I want to transpose this table to look like

Col A Col B Col C Col D
AAA 1 3 2
BBB 2 3 5

Thanks

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-06-17 : 12:41:45
may I ask why???

try this:
http://www.sqlteam.com/item.asp?ItemID=2955


Corey
Go to Top of Page

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2004-06-17 : 12:41:45
Look At Pivot Table in BOL

Jim
Users <> Logic
Go to Top of Page

mdhingra01
Posting Yak Master

179 Posts

Posted - 2004-06-17 : 13:16:56
Jim: You asked why?

Because the data is being exported to Visual Foxpro, but the data structure is different, so it needs to be transposed.

Thanks
Go to Top of Page
   

- Advertisement -