Solved

Definition of Different Join Types

Posted on 2002-05-15
3
387 Views
Last Modified: 2008-03-06

How do the different SQL joint types affect record selection when using Crystal Reports?

0
Comment
Question by:emal1975
[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
  • 2
3 Comments
 
LVL 101

Accepted Solution

by:
mlmcc earned 50 total points
ID: 7011955
The joins available to you depend on where you are trying to write them.

An equal join - Includes records from both tables when the joined fields are equal.

A left outer join - Includes all records from the table on the left and records from the right table where the join fields are equal.

A right outer join - Includes all records from the table on the right and records from the left table where the join fields are equal.

Examples

Table1
Rec_Key   LastName     SuperKey
1         Smith          1
2         Jones          2
3         James          4        

Table2
Rec_Key   Supervisor
1         Wilson
2         Johnson
3         Mathews

EQUAL JOIN

Select LastName, Supervisor
from Table1 join table2 on SuperKey = table2.Rec_Key

returns
LastName     Supervisor
Smith        Wilson
Jones        Johnson


LEFT OUTER JOIN
Select LastName, Supervisor
from Table1 left outer join table2 on SuperKey = table2.Rec_Key

returns
LastName     Supervisor
Smith        Wilson
Jones        Johnson
James        <NULL>

RIGHT OUTER JOIN
Select LastName, Supervisor
from Table1 right outer join table2 on SuperKey = table2.Rec_Key

returns
LastName     Supervisor
Smith        Wilson
Jones        Johnson
<NULL>       Mathews

Hope this helps.

If you have questions on a specific example please post it.  Remember the exact SQL statement is database and reporting tool specific.

mlmcc
0
 

Author Comment

by:emal1975
ID: 7012079
Thanks so much.
That makes a lot more sense than the included help guide.

0
 
LVL 101

Expert Comment

by:mlmcc
ID: 7012445
Glad to help

Thanks for the points
mlmcc
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

635 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