Bad query: select P.FirstName, P.MiddleName, P.LastName,P.BirthDate,P.BirthYear,P.Height,P.Weight,P.Side,P.Rank,P.Comments,R.ID as RID, R.Name as Role,R.Player,C.City as City,T1.Name as Team1,C1.City as City1,T2.Name as Team2,C2.City as City2, PT.Team_ID as Team, PT.Number as Num from Persons P left join Roles R on P.Role_ID=R.ID left join Participation PT on (P.ID=PT.Person_ID AND PT.StartDate<=NOW() AND (PT.EndDate>=NOW() OR PT.EndDate IS NULL))left join Teams T1 on P.School_ID=T1.ID left join Cities C1 on T1.City_ID=C1.ID left join Teams T2 on P.School2_ID=T2.ID left join Cities C2 on T2.City_ID=C2.ID left join Cities C on P.City_ID=C.ID where P.ID=5974 ORDER BY PT.ID DESC