Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Transpose of rows to columns
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Constraint Violating Yak Guru

309 Posts

Posted - 07/08/2005 :  10:34:45  Show Profile  Reply with Quote
I need to transpose my rows to columns.
This is my scenario with sample data

srcdata subid srcdata2 srcdata3
1000002 1
2000003 2
3000020 3
1000030 1
2000009 2
3000021 3

I want to populate columns srcdata2 and srcdata3 whenever subid = 1 with the values of srcdata
when subid = 2 and 3 respectively

srcdata subid srcdata2 srcdata3
1000002 1 2000003 3000020
2000003 2
3000020 3
1000030 1 2000009 3000021
2000009 2
3000021 3

Any suggestions/inputs would be very helpful indeed


Premature Yak Congratulator

22864 Posts

Posted - 07/08/2005 :  10:42:29  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
This may help you


Failing to plan is Planning to fail
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000