我在 Access DB 的 VB 应用程序中有这个查询:
SELECT DISTINCT Specialization, MAX(a.faultZone) AS faultZone, ISNULL(a.faultCount, 0) AS NoOfFaults FROM Technicians AS t
LEFT JOIN
(
SELECT DISTINCT Faults.[Type] AS faultType, MAX(Faults.[Zone]) AS faultZone, COUNT(Faults.[Type]) AS faultCount
FROM Faults "
WHERE Faults.[Zone] = 8 " ' this value will be from variable
GROUP BY Faults.[Type] "
) AS a
ON (t.Specialization = a.faultType)
WHERE t.specialization <> 'None' "
GROUP BY a.faultCount, t.Specialization
它给出了以下我无法解决的问题......
“查询表达式'ISNULL(a.faultCount,0'中的函数使用的参数数量错误。”
我想要实现的只是将值设置NoOFFaults
为零,这意味着特定区域没有故障。
谢谢你