Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Difference between left and right outer join

Status
Not open for further replies.

crystaldev1

Programmer
Nov 6, 2003
232
US
I'm using CR 9 and SQL Server 2005. I understand the concept of left/right outer join but I would like to know if there's a difference between using left outer join vs right outer join other than the location (left or right) from the link. Also, from database expert, it seems like the arrow in the link does not point consistently correctly. I think it would make my life easier if it can point according to the outerjoin.
 
Hi,
The difference is in which table's rows will all be returned even when data does not exist in one table's linked fields.

( See more info here:
)

While the arrow might be useful, the additional programming needed might not be worth it since a simple right-click on the link will tell you which type it is..




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
On Links, you can choose [Auto-Arrange]. (At least you can in version 10.) This will put 'from' on the left and 'to' on the right. Does this help?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
This is just kind of a quirky thing about SQL:
SQL likes to reorder your tables to a 'optimum' organization. Sometimes it changes your left outers to right outers because for some reason that is viewed as more efficient.

In crystal I always use left outer joins for readablilty reasons.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top