Solved

Three (3) table join (sql)

Posted on 2002-05-27
5
168 Views
Last Modified: 2010-05-02
Hello All,

I need to join all records from the following tables.

Table1 (Main Table): tbl_DR_Records (Primary Key: DReferID)

Join the records from these tables:

Table2: tbl_DR_ExplainAction (Field: DReferID)
Table3: tbl_DR_MultiSpots (Field: MEReferID)

Thanks as always...

-ADawn
0
Comment
Question by:ADawn
5 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 7037042
select *
from tbl_DR_Records as T1
left join tbl_DR_ExplainAction as T2
on t1.DReferID = T2.DReferID
left join tbl_DR_MultiSpots AS T3
on t1.DReferID = T3.MEReferID
0
 
LVL 5

Expert Comment

by:kcm76
ID: 7037652

Select D.*
from tbl_DR_Records D, DR_ExplainAction E, Multispots M
where D.DReferID = E.DReferID and D.DReferID = M.MEReferID

ALL THE BEST

KCM
0
 
LVL 1

Expert Comment

by:killer5
ID: 7038466
a safer way to do it... :D
The problem with the other SQLs is that it will not return any records if there are no records in DR_ExplainAction and/or DR_MultiSpots

SELECT tbl_DR_Records .*
FROM tbl_DR_Records T1
LEFT OUTER JOIN
 tbl_DR_ExplainAction T2 ON T1.DReferID = T2.DReferID
LEFT OUTER JOIN
 tbl_DR_MultiSpots T3 ON T3.MEReferID = T1.DReferID
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7038744
killer5, what is the diffence between your comment and mine?
0
 

Author Comment

by:ADawn
ID: 7099632
Thanks for your help.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access Search and Replace Using VBA 6 80
Adding to a VBA? 6 76
Add and format columns in vb6 7 63
MS Access 03, TransferText, decimal places 8 78
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question