Can someone view the following code and tell me why I am getting duplicate name records returning?
SELECT DISTINCT [Input Table].ID, [Input Table].Last_Name, [Input Table].First_Name, [Input Table].Cost_Center, April.April_Premium, Aug.Aug_Premium, Dec.Dec_Premium, Feb.Feb_Premium, Jan.Jan_Premium, July.July_Premium, June.June_Premium, May.May_Premium, Nov.Nov_Premium, Oct.Oct_Premium, Sep.Sep_Premium
FROM (((((((((((April INNER JOIN Aug ON April.ID = Aug.ID) INNER JOIN Dec ON April.ID = Dec.ID) INNER JOIN Feb ON April.ID = Feb.ID) INNER JOIN [Input Table] ON April.ID = [Input Table].ID) INNER JOIN Jan ON April.ID = Jan.ID) INNER JOIN July ON April.ID = July.ID) INNER JOIN June ON April.ID = June.ID) INNER JOIN March ON April.ID = March.ID) INNER JOIN May ON April.ID = May.ID) INNER JOIN Nov ON April.ID = Nov.ID) INNER JOIN Oct ON April.ID = Oct.ID) INNER JOIN Sep ON April.ID = Sep.ID;
Originally posted by Pat Phelan
Did you maybe want to put a leash on the thing by insisting that something in the WHERE clause be equal to the [INPUT TABLE].ID value ??? Methinks you are getting a bounded cartesian join.
That is there, between the join to Feb and the join to Jan - just to add to our confusion!