When you join to a collection property, understand that the alias you give it should be singular, not plural. You are actually joining to a particular member of the collection.
Here are some examples:
Code:
SELECT DISTINCT Doctor
FROM Doctor AS Doctor
JOIN Doctor.Patients AS Patient
WHERE Patient.Age > 50
or
Code:
FROM Doctor AS Doctor
WHERE EXISTS (
FROM Doctor AS Doctor2
JOIN Doctor2.Patients AS Patient2
WHERE Doctor2 = Doctor
AND Patient2.Age > 50)
If you do something like
Code:
FROM Doctor AS Doctor
JOIN Doctor.Patients AS Patient
and you don't filter the patient down to a unique one within the collection, the "rows" (object arrays) in the result set will repeat the same doctor with each distinct patient.