Re: combine rows dependent on match two columns

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Tue, 10 Mar 2009 17:21:44 +0100
Message-ID: <49b69374$0$198$e4fe514c_at_news.xs4all.nl>



NOVA schreef:
> On 10 مارس, 16:50, Shakespeare <what..._at_xs4all.nl> wrote:

>> NOVA schreef:
>>
>>
>>
>>
>>
>>> Dear all,
>>> If I have table like this
>>> A aa B bb
>>> 1 5
>>> 2 7
>>> 1 7
>>> 3 6
>>> I want to make the result like this
>>> A or B aa bb
>>> 1 5 7
>>> 2 7
>>> 3 6
>>> A or B is a column has all data avaliable in both A and B
>>> help please
>> I'm sure there are better ways, but how about
>>
>> select distinct nvl(t1.a,t2.b), t1.aa, t2.bb from example t1, example t2
>> where t1.a=t2.b
>> or ( t1.a is null and t2.b is not null and not exists (select 1 from
>> example t3 where t3.a=t2.b))
>> or ( t2.b is null and t1.a is not null and not exists (select 1 from
>> example t4 where t1.a=t4.b))
>>
>> Shakespeare- إخفاء النص المقتبس -
>>
>> - عرض النص المقتبس -
> 
> I know this way
> 
> I want better ways
> 
> thanks

Well, you could at least have told us that..... ;-) Shakespeare Received on Tue Mar 10 2009 - 11:21:44 CDT

Original text of this message