Solved

Definition of Different Join Types

Posted on 2002-05-15
3
382 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
Comment Utility
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
Comment Utility
Thanks so much.
That makes a lot more sense than the included help guide.

0
 
LVL 100

Expert Comment

by:mlmcc
Comment Utility
Glad to help

Thanks for the points
mlmcc
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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 …
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 tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now