Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Definition of Different Join Types

Posted on 2002-05-15
3
Medium Priority
?
389 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 101

Accepted Solution

by:
mlmcc earned 200 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

963 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