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

OUTER JOINS

Status
Not open for further replies.

mjstar

Programmer
Sep 3, 2001
8
CH
I'm wondering wether I understood outer joins or not. I'm working with Access 97. When I try the following query, I have 39 rows :
SELECT ev.* FROM ev.

But when I use an left outer join this way, I have many, many rows more:
SELECT ev.*, gt.KEY2A
FROM ev LEFT JOIN gt ON ev.STATUS1=gt.KEY2A

Is it normal ? I thought when you use a left join, I would have the same number of rows. It would just add gt fields corresponding or not to the criteria ev.STATUS1=gt.KEY2A.

Am I right ?

Thanks. Alain TSARAFIDY
To think about the person you would like to be is to waste your time. Just be yourself
-Anonymous
 

If the 2nd table, gt, contains multiple records for each key2a value then the result you are getting is to be expected whether using an INNER or OUTER (left or right) JOIN.

The LEFT JOIN basically says, "give me all records from ev and every record that matches on gt." It is not limited to just one record that matches. You can add a DISTINCT or GROUP BY clause to limit the records returned in the result set. Terry L. Broadbent
Life would be easier if I had the source code. -Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top