Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 1st, 2009, 12:10 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default Pivot?

Good Morning,

I have a 2 column table like below, where there is a variable number of procedure codes for hundreds of test codes:

TC PC
1234 ABC
1234 DEF
1234 GHI
1234 JKL
5678 MNO
5678 PQR

And I want to make it like this.

TC PC
1234 ABC, DEF, GHI, JKL
5678 MNO, PQR


There are 8 million rows in the table.

First, is it possible accomplish this with TSQL?

Any links that might assist my reserach would be great also.

Thanks in advance for any help, BPH

Last edited by bph; September 1st, 2009 at 12:16 PM..
 
Old September 1st, 2009, 12:49 PM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following thread:
http://bytes.com/topic/sql-server/an...s-into-columns
__________________
Om Prakash Pant
Click the "Thanks" button if this post helped you.
The Following User Says Thank You to om_prakash For This Useful Post:
bph (September 1st, 2009)
 
Old September 1st, 2009, 01:21 PM
bph bph is offline
Friend of Wrox
 
Join Date: Dec 2003
Posts: 102
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Thanks. I'm perusing that info and hopefully can draw a solution from knowledge gained.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Cumulative % in Pivot Umasriram2 Excel VBA 0 August 7th, 2008 08:30 AM
Pivot Table vbsolo Excel VBA 3 November 23rd, 2005 01:28 AM
Pivot Table mikeparams SQL Server 2000 1 February 9th, 2005 10:10 AM
Pivot Tables smartgir Excel VBA 0 May 12th, 2004 10:08 AM
Pivot Table ramdasu Excel VBA 0 October 23rd, 2003 03:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.