Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
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 October 4th, 2004, 03:49 PM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default URGENT : Concatenate multiple records from table

I have multiple records in a table pertaining to a business key

ID Name Value
01 ABC 180
01 ABC 219
01 ABC 320
02 RAT 111
03 BAT 654

I want to extract this data into a file in this format:

ID Name Value
01 ABC 180, 219, 320
02 RAT 111
03 BAT 654

Basically concatenate the values of one field based on the business key (in above example its ID)

Please suggest the easiest way to get this done.


Thanks & Regards
 
Old October 5th, 2004, 09:49 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Did you search here on that? There were many discussions on that topic. IMO, you might want do that contatenation from you frontend apps and write to a file.

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old October 7th, 2004, 11:04 PM
Authorized User
 
Join Date: Apr 2004
Posts: 70
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Tom Kyte's stragg function can be a lifesaver here.

Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC





Similar Threads
Thread Thread Starter Forum Replies Last Post
Concatenate multiple records into one Raman Pahwa SQL Server ASP 1 August 19th, 2008 02:57 PM
Deleting multiple records from the same table jscrogg Beginning VB 6 3 June 12th, 2006 05:30 AM
multiple records in a table fadege Classic ASP Databases 0 October 13th, 2005 07:40 AM
Concatenate multiple records from table to single Ron Howerton SQL Language 6 August 23rd, 2004 08:49 AM
How Can I Delete Multiple Records From a Table? Lucy SQL Server 2000 5 May 12th, 2004 05:20 AM





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