Why does my left join in Access have fewer rows than the left table?

前端 未结 4 1882
挽巷
挽巷 2021-01-19 10:48

I have two tables in an MS Access 2010 database: TBLIndividuals and TblIndividualsUpdates. They have a lot of the same data, but the primary key may not be the same for a gi

4条回答
  •  春和景丽
    2021-01-19 11:36

    Drop any indexes from both tables which include those JOIN fields (FirstName, LastName, and DateBorn). Then see whether you get the expected 4,149 rows with this simplified query.

    SELECT
        i.PersonID AS OldID, 
        u.PersonID AS UpdateID
    FROM
        TblIndividualsUpdates AS u
        LEFT JOIN TblIndividuals AS i
        ON
            (
                (i.FirstName = u.FirstName) 
            AND (i.LastName = u.LastName) 
            AND (i.DateBorn = u.DateBorn)
            );
    

提交回复
热议问题