ContactFormTypeExist を作成しました:
SELECT DISTINCT Contact.ContactID, Form.FormTypeID
FROM Contact
INNER JOIN ContactForm
ON Contact.ContactID = ContactForm.ContactID
INNER JOIN Form
ON ContactForm.FormID = Form.FormID
次に、上記の質問で説明されている ContactFormTypesRequired を ContactFormTypeExist に外部結合で結合して、関連する FormTypeID が欠落している ConactID を取得します。
SELECT ContactFormTypesRequired.ConactID
FROM ContactFormTypeExist
RIGHT JOIN ContactFormTypesRequired
ON (ContactFormTypeExist.FormTypeID = ContactFormTypesRequired.FormTypeID)
AND (ContactFormTypeExist.ConactID = ContactFormTypesRequired.ConactID)
WHERE (((ContactFormTypeExist.ConactID) Is Null));
これにより、ContactType に必要な FormTypes が欠落している Contacts のすべての ContactID が返されます。