473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

full join 3 tables

Hello all

I am working with oracle 10i

I need to join 3 tables in 1 sql statements. (please see attached)
it looks simple, but i have spent many hours without any luck,
each table have 3 identical columns and several different columns i need to join all the tables and all the records from each table.

i have tried the full join in 2 tables but i get all records from 1 table and only the repiting records from the second table, but i am not getting the no matching recors from the second table.
Of corse in reality these tables are much more complex, but this will give me an idea.
Please help, any suggestion is well appreciated. Thanks a lot
Attached Images
File Type: jpg join3tables.jpg (17.5 KB, 799 views)
Mar 15 '10 #1
2 4694
rski
700 Expert 512MB
So you need full outer join for these three tables?
Mar 16 '10 #2
you mean something like this ?

select case when a.myid is not null then a.myid
when a.myid is null and b.myid is not null then b.myid
when a.myid is null and b.myid is null and c.myid is not null then c.myid
else null
end myid
,case when a.subj is not null then a.subj
when a.subj is null and b.subj is not null then b.subj
when a.subj is null and b.subj is null and c.subj is not null then c.subj
else null
end subj
,case when a.tube is not null then a.tube
when a.tube is null and b.tube is not null then b.tube
when a.tube is null and b.tube is null and c.tube is not null then c.tube
else null
end tube
,case when a.site is not null then a.site
when a.site is null and b.site is not null then b.site
when a.site is null and b.site is null and c.site is not null then c.site
else null
end site
,an1
,an2
,an3
,an4
,an5
,an6
,an7
from tst.roche_a a
full outer join tst.roche_b b on (a.myid = b.myid and a.subj = b.subj and a.tube = b.tube and a.site = b.site)
full outer join tst.roche_c c on (a.myid = c.myid and a.subj = c.subj and a.tube = c.tube and a.site = c.site)
order by myid nulls last
;
Mar 21 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dave | last post by:
Hi I have the following 4 tables and I need to do a fully outerjoin on them. create table A (a number, b number, c char(10), primary key (a,b)) create table B (a number, b number, c ...
10
by: Jay Chan | last post by:
I keep getting the following error message when I run a serie of SQL commands: Server: Msg 9002, Level 17, State 6, Line 15 The log file for database 'tempdb' is full. Back up the transaction...
7
by: alexcn | last post by:
I have the following query: SELECT dbo.tSymExch.exCode, dbo.tSymGrp.sgCode, dbo.tSymMain.smCode FROM dbo.tSymExch FULL OUTER JOIN dbo.tSymGrp ON dbo.tSymExch.exID =...
4
by: Anthony Robinson | last post by:
I was actually just wondering if someone could possibly take a look and tell me what I may be doing wrong in this query? I keep getting ambiguous column errors and have no idea why...? Thanks in...
2
by: Lee | last post by:
I have two identical schema tables (one in a production library and another in a development library) and I need to be able to easily compare the data in them for errors and omissions. With...
2
by: Cory | last post by:
i have two tables, Event1 and Event2. They both have fields called contactID and eventID in them. Some of the contactID's between the tables are equal and some are not. I want to do a full outer...
1
by: Martijn van Oosterhout | last post by:
Today I got the error: ERROR: FULL JOIN is only supported with mergejoinable join conditions Which is really annoying since a full join is exactly what I wanted. I guess the alternative is to...
11
by: frizzle | last post by:
Hi groupies I'm building a news site, to wich a user can add new items into a mySQL db. It's still in testfase, but it's so extremely slow, i want to figure out what i'm doing wrong, or what to...
20
by: FloggingDolphin | last post by:
Hi there, I'm kinda new to this so I hope I've explained it properly. Please ask if you need any additional info. Here is a simplified version of the issue I'm experiencing: I have two...
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.