Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Combine records
> 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