Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Definition of Different Join Types

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

664 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