p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Database > SQL Language
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 1st, 2009, 01:10 PM
bph bph is offline
Authorized User
Points: 402, Level: 7
Points: 402, Level: 7 Points: 402, Level: 7 Points: 402, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: , , .
Posts: 93
Thanks: 1
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 01:16 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old September 1st, 2009, 01:49 PM
Friend of Wrox
Points: 1,882, Level: 17
Points: 1,882, Level: 17 Points: 1,882, Level: 17 Points: 1,882, Level: 17
Activity: 7%
Activity: 7% Activity: 7% Activity: 7%
 
Join Date: May 2004
Location: India
Posts: 563
Thanks: 0
Thanked 14 Times in 14 Posts
Default

Please check the following thread:
http://bytes.com/topic/sql-server/an...s-into-columns
__________________
Om Prakash Pant
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
The Following User Says Thank You to om_prakash For This Useful Post:
bph (September 1st, 2009)
  #3 (permalink)  
Old September 1st, 2009, 02:21 PM
bph bph is offline
Authorized User
Points: 402, Level: 7
Points: 402, Level: 7 Points: 402, Level: 7 Points: 402, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2003
Location: , , .
Posts: 93
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks. I'm perusing that info and hopefully can draw a solution from knowledge gained.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cumulative % in Pivot Umasriram2 Excel VBA 0 August 7th, 2008 09: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 11:08 AM
Pivot Table ramdasu Excel VBA 0 October 23rd, 2003 04:16 AM



All times are GMT -4. The time now is 12:26 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc