[英]Syntax error (missing operator) in query expression in SQL Server
MS Access does not directly support DISTINCT
syntax inside of an aggregate function. MS Access 不直接支持聚合 function 内的
DISTINCT
语法。 One workaround here would be to take the average of a subquery which finds the distinct salaries:这里的一种解决方法是对找到不同薪水的子查询求平均值:
SELECT AVG(salary) AS avrage
FROM
(
SELECT DISTINCT E.salary
FROM (aircraft AS A
INNER JOIN certified AS C ON A.aid = C.aid)
INNER JOIN employees AS E ON C.eid = E.eid
WHERE A.cruisingrange > 1000
) t;
Note that I have also converted your old school implicit join syntax to modern explicit join syntax.请注意,我还将您的旧式隐式连接语法转换为现代显式连接语法。 This is the preferred way of writing SQL these days.
这是目前编写 SQL 的首选方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.