Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Sql for generating one string out of several records
I have a situation where I've got a table with say two coloumns, named
GROUP_NAME and TEXT.
So a sample content of this table might be:
GROUP_NAME TEXT
GRP1 London GRP1 Washington GRP1 Hamburg GRP2 Sunday GRP2 Monday GRP2 Wednesday
I need a sql something like this:
select ...(something....)
from DEMO_TABLE
where GROUP_NAME = 'GRP1'
and this should give me a string like this: 'London,Washington,Hamburg'
I know that I can write a function which has GroupName as an inputparameter and that returns the wanted string. But I need to be able to solve this problem with an ordinary sql - ie without any userdefined function.
I would appreciate very much any help on this matter.
Regards Sindre Idsal Received on Sun Oct 07 2001 - 14:17:32 CDT