?
Solved

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

Posted on 2003-11-21
4
Medium Priority
?
2,670 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
FBIAGENT earned 800 total points
ID: 9799380
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 9799430
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
ID: 26145251
Broken links for asktom - please copy-paste the solution here.

Thanks,
0
 
LVL 2

Expert Comment

by:mahmudaq
ID: 26145431
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

752 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