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: Merge Multiple Rows Into Single Result

Re: Merge Multiple Rows Into Single Result

From: Niko <nick_wakefield_at_hotmail.com>
Date: 20 Nov 2002 10:47:00 -0800
Message-ID: <9da94cd1.0211201047.735891a5@posting.google.com>


Is this new to 9i, I had been looking for this ability. Thanks for the link it's the most useful piece of information I have had in ages, of a newsgroup.

brotherhou_at_yahoo.com (konghou) wrote in message news:<c19678a1.0211191926.1af7f73c_at_posting.google.com>...
> Not possible to do it in a query but a user-defined generic aggregate
> function can be written... refer to post "Re: How to write
> user-defined aggregate function": there is a link to the article
> http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/appdev.920/a96595/dci11agg.htm#1004572
> which talks about how to write this.
>
> nick_wakefield_at_hotmail.com (Niko) wrote in message news:<9da94cd1.0211182258.16351d19_at_posting.google.com>...
> > Errr No _ I finished school a long time ago - funny.
> >
> > nick_wakefield_at_hotmail.com (Niko) wrote in message news:<9da94cd1.0211140835.56fa096b_at_posting.google.com>...
> > > Hi,
> > >
> > > Does anyone know a way to do the following, given a table like
> > >
> > > Field_A, Field_B
> > > a first word
> > > a second word
> > > a third word
> > >
> > >
> > > then runa group by query on it to merge the contents of field_b
> > > seperating with commas.
> > >
> > > select field_a, merge(field_b,',')
> > > from table
> > > group by a
> > >
> > > resulting in
> > > Field_A New_String
> > > a first word, second word, thrid word
Received on Wed Nov 20 2002 - 12:47:00 CST

Original text of this message

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