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

Inner/Outer/Left/Right Joins...what are they?

Status
Not open for further replies.

chpicker

Programmer
Apr 10, 2001
1,316
Can anyone explain joins to me? There are some things that I want to do with SQL commands that require pulling selective records from multiple tables and I'm pretty sure that Joins are the key to pulling it off...however I don't know what the different joins do or how they work. The documentation seems to assume you know what they are, so it was probably something I learned in Calculus and promptly forgot about. Experimentation has lead to confusing results. Can anyone help?
 
When you select records from two tables using SQL...

Inner Join .... Only records from both tables that match the join criteria.

Left Join ... All records from the table on the left side of the join criteria AND ONLY records that match the join criteria from the table on the right side of the join criteria.

Right Join... All records from the table on the right side of the join criteria AND ONLY records that match the join criteria from the table on the left side of the join criteria.

Full Join ... All records from both tables whether or not they match the join criteria

Outer Join ... An association between input sources in a query that allows you to select rows that match plus those that do not match the join condition. You can select all of the rows from one input source and matching rows from the other input source with a Left Outer Join, Right Outer Join, or Full Outer Join. You can also select all of the rows from both input sources, regardless of matching, with a Full Outer Join.

I have provided a collection of help as provided by VFP .. hope this make sense to you..
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Ramani,

To avoid confusion, it should be noted that only outer joins can be left and right. Inner joins can't be left and right. --DED
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top