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

Home -> Community -> Usenet -> c.d.o.server -> Re: Merge Multiple Rows Into Single Result

Re: Merge Multiple Rows Into Single Result

From: TurkBear <john.greco_at_dot.state.mn.us>
Date: Tue, 19 Nov 2002 08:34:15 -0600
Message-ID: <gtiktu0kkuqe2p4uoj50993on6k59tpt3e@4ax.com>

  1. Stop cross-posting
  2. HINT - look into subqueries ( sometimes called in-line views)

nick_wakefield_at_hotmail.com (Niko) wrote:

>A cursor and a loop would be ideal, however I need to do it in a query
>not pl/sql. The sybase ASA List function would be cool but I don't
>know the oracle equivalent, never needed to know until now.
>
>
>Daniel Morgan <dmorgan_at_exesolutions.com> wrote in message news:<3DD3D77C.FD124E08_at_exesolutions.com>...
>> Niko wrote:
>>
>> > 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
>>
>> Given that you are the second person in as many days asking the same
>> question I can only presume that this is a class assignment ... so you
>> will need to figure it out yourself.
>>
>> Hint: It requires a cursor and a loop.
>>
>> Daniel Morgan
Received on Tue Nov 19 2002 - 08:34:15 CST

Original text of this message

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