Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Concatanating results in one string

Re: Concatanating results in one string

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Wed, 13 Nov 2002 19:12:09 GMT
Message-ID: <3DD2A406.68342146@exesolutions.com>


Joe Smith wrote:

> Thanks for the answer. In fact, I'm imposed to return the results (e-mail
> addresses of a particular user) in one single value, in the form of a comma
> separated list.
>
> Bye!
>
> "Alan Mills" <Alan.Mills_at_nospamservices.fujitsu.com> a écrit dans le message
> de news: aqtku6$dut$1_at_news.icl.se...
> >
> > "Joe Smith" <nospam_at_nospam.com> wrote in message
> > news:aqtjts$s97$1_at_news-reader10.wanadoo.fr...
> > > Hi,
> > >
> > > I'm trying to do a query to return all the values in one column
> > concatanated
> > > as if it was only one result:
> > >
> > > Field
> > > ====
> > > "A"
> > > "B"
> > > "C"
> > >
> > >
> > > select ??? from table ==> "ABC"
> > >
> > > Is this possible?
> > > I've looked the SQL reference, but I can't find anything there (the
> concat
> > > function doesn't seem to allow this, does it?)
> > >
> > > I'm using Oracle 8.1.7
> > >
> > > Thanks in advance!
> > >
> > I've never seen anythign that would do that! you'll have to write a
> PL/SQL
> > function/procedure to do it prgramatically. Pass the query to it as a
> > parameter and it can return (using dynamic sql) the results you're after.
> I
> > suppose you could also do the usual gubbnins to ensure you can call the
> > function from within SQL statements.
> >
> > I'm curious as to what the application is though. Why do you have one
> data
> > item spread over multiple records?
> >
> >

Then you need to use either an anonymous block or procedure with a cursor and a loop.

And unless this is a purely academic exercise ... your quest is a clear indication that the schema needs redesign.

Daniel Morgan Received on Wed Nov 13 2002 - 13:12:09 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US