I am trying to join 5 tables in a sql server 2k db. Does anyone know of a good set of guidelines for doing this? Alternately, could someone find the problem in the following query?The query that I am using is listed here (please let me know if I am violating any programming guidelines on this):SELECT p.ParticipantID, pr.Age, ir.FnlTime, e.EventDate FROM Participant p INNER JOIN PartRace pr ON p.ParticipantID = pr.ParticipantIDJOIN IndResults ir ON pr.ParticipantID = ir.ParticipantIDJOIN RaceData rd ON ir.RaceID = rd.RaceIDJOIN Events e ON e.EventID = rd.EventIDWHERE rd.Dist = '5_km' AND p.Gender = 'm' AND ir.FnlTime <> '00:00' AND e.EventGrp = 1ORDER BY ir.ParticipantID
The problem that I am having is that if a participant shows up multiple times (which they could do since this is designed to get the performances for an event over a series of years) it does not associate the correct data from year to year. Basically some times show up where they shouldn't.