如何在ms访问中获得与下面的sql代码相同的结果?它不承认EXCEPT条款……
SELECT DISTINCT P.Name,T.Training FROM Prof AS P,Training_done AS TC,Trainings AS T WHERE (P.Name Like '*' & NameProf & '*') AND (P.Primary_Area = T.Cod_Area) EXCEPT SELECT DISTINCT P.Name,Trainings AS T WHERE (P.Name Like '*' & NameProf & '*') AND (P.Cod_Prof = TC.Cod_Prof);
提前致谢!
解决方法
为了摆脱除外,您可以结合条件并否定第二个:
SELECT DISTINCT P.Name,Trainings AS T WHERE ((P.Name Like '*' & NameProf & '*') AND (P.Primary_Area = T.Cod_Area)) AND NOT ((P.Name Like '*' & NameProf & '*') AND (P.Cod_Prof = TC.Cod_Prof));