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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join synopsis?

Status
Not open for further replies.

MorganGreylock

Programmer
Joined
Jan 30, 2001
Messages
223
Location
US
Could someone possibly post (or post a link to) a synopsis of the different types of joins (left, right, inner, outer, etc)
and what they do and when to use them? I've searched the web for some documentation, but most of the sites I've seen don't even enough examples for me to determine what it is I need to do.

It would also just be very useful knowledge and reference...

Thanks in advance,
MG
 
Which relational Database will you be using?
 
I didn't think it would matter, but in this project I am using postgresql on redhat linux.

MG
 
The nature of the join depends on the cardinality of the relation between the 2 tables.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Yes, joins are pretty much the same in any database but most of the stuff I know of is geared to DB2. Here's a link to a site which has a download that includes a good section on joins.


If you want some detailed stuff on outer joins, I can send you email.
 
AFAIK, outer joins are for 0-1 or 0-n relations.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
AFAIK, outer joins are for 0-1 or 0-n relations.
not necessarily

you could have a 1-n relationship, for example between students and courses (student must have at least one course, so it's 1-n not 0-n) and yet still want to run a left outer join to find students who don't take math

rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top