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 -> Combine records

Combine records

From: Ning li <ningli2000_at_worldnet.att.net>
Date: Thu, 11 Dec 2003 06:20:54 GMT
Message-ID: <a1UBb.432671$0v4.20559292@bgtnsc04-news.ops.worldnet.att.net>


Hi,

    I am running a join query which returns several records with the same id (c_id). The query and the selected records are as the following:

     select c_id,  product, country, region
     from  mytable1

    Results:        c_id          product            country        region
                         1             toy1                  Turkey
Middle East
                         1             toy1                  Turkey
Europe
                         ..................

       As you can see, a country can belong to multiple regions. If the
records have the same values for all the columns except the region, like the above,

    I would like to combine the records into one record, as the following:

           c_id          product            country           region
              1             toy1               Turkey       Middle East -
Europe

       Is there a simple way to do it or is PL/SQL needed for the job?

       I don't have control over the table design BTW.

       Thanks in advance.

      Nick Received on Thu Dec 11 2003 - 00:20:54 CST

Original text of this message

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