Solved

Three (3) table join (sql)

Posted on 2002-05-27
5
169 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 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
VB6 / DAO 3.6 / run time error: Couldn't find installable ISAM 7 119
Windows 10 start screen issues 9 62
message box in access 4 52
Add and format columns in vb6 7 73
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

696 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