?
Solved

Three (3) table join (sql)

Posted on 2002-05-27
5
Medium Priority
?
171 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

752 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