Solved

Definition of Different Join Types

Posted on 2002-05-15
3
384 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
  • 2
3 Comments
 
LVL 100

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 100

Expert Comment

by:mlmcc
ID: 7012445
Glad to help

Thanks for the points
mlmcc
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

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…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

785 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