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

Re: Combine records

From: NoName <nobody_at_nowhere.com>
Date: Thu, 11 Dec 2003 11:16:59 +0100
Message-ID: <br9fg8$dvu$1@fata.cs.interbusiness.it>


> GROUP BY Clause.

Hello,
it's not as simple as it looks, in my opinion.

I almost found a solution, but still there are two records. A first, raw solution could be to join the same table from two instances, and to exclude rows with same values in c_id, product and country fields.

select t1.c_id, t1.product, t1.country, t1.region || ' - ' || t2.region from mytable t1, mytable t2
where t1.c_id=t2.c_id

   and t1.product=t2.product
   and t1.country=t2.country
   and t1.region<>t2.region

But the following produces two rows: one woth region = "Middle East - Europe" and the other with region = "Europe - Middle East".

Maybe the path is right, it has to be fine-tuned.

Hope this could help... Received on Thu Dec 11 2003 - 04:16:59 CST

Original text of this message

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