![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
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- إخفاء النص المقتبس - - عرض النص المقتبس - |
#4
| |||
| |||
|
|
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- إخفاء النص المقتبس - - عرض النص المقتبس - |
#5
| |||
| |||
|
|
On 10 مارس, 16:50, Shakespeare <what... (AT) xs4all (DOT) 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 |
#6
| |||
| |||
|
|
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 |
#7
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |