SELECT DISTINCT People.*, People_Email.Email FROM People LEFT JOIN People_Email ON People.ID = People_Email.Person WHERE People.Active = 1 AND (People_Email.Primary = 1 OR IsNULL(People_Email.Primary)) AND People.Status = 4 AND (People.Ende > #10/08/2024# OR IsNULL(People.Ende)) AND People.ID = 788 ORDER BY People.Arbeitgeber, People.Name, People.Vorname