有誰知道一種方法來簡化這個WHERE表達式?SQL WHERE在多對多或多對多的空
WHERE (
(@UserSpecialtyID in
(
SELECT CharacteristicSpecialties_Id
FROM ModalityVariantSpecialty
WHERE ModalityVariants_Id = ModalityVariants.Id
)
)
OR
NOT EXISTS
(
SELECT CharacteristicSpecialties_Id
FROM ModalityVariantSpecialty
WHERE ModalityVariants_Id = ModalityVariants.Id
)
)
你能發表整個聲明嗎? – steinar 2011-03-14 21:21:41