Solved

Agregate function, like sum(), to concatenate strings in group by

Posted on 2003-11-21
4
2,664 Views
Last Modified: 2010-05-18
Oracle8i Enterprise Edition Release 8.1.7.0.0

Let's say i have this data:

Name Hobbies
Joe Read
Joe Sports
Bob Videogames
Bob Sports
Bob Cook

I want a query to generate this output:
Name    Hobbies
Joe      Read, Sports
Bob     Videogames, Sports, Cook

This is pretty much an aggregate function that concatinates text across rows (like sum() adds numbers across rows). Is there such a function? Can I create such a function? Is there another way to do this? My ASPs run the query, but I don't want to have the ASP go through the data and do the grouping. It would be nice if the SQL just returns the data in a state ready to be displayed.
0
Comment
Question by:robysath
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
FBIAGENT earned 200 total points
Comment Utility
0
 
LVL 23

Expert Comment

by:seazodiac
Comment Utility
of course you can do this in SQL query.
I will direct you to a link (credit to Tom)

http://asktom.oracle.com/pls/ask/f?p=4950:8:3253926000499873802::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:802901216021,
0
 
LVL 2

Expert Comment

by:mahmudaq
Comment Utility
Broken links for asktom - please copy-paste the solution here.

Thanks,
0
 
LVL 2

Expert Comment

by:mahmudaq
Comment Utility
I see why you didn't paste it, here's the new link to the same solution:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2196162600402
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now