我为 Access DB 编写了这个查询。
queryText = "SELECT Technicians.ID, firstName, lastName, Technicians.[Zone],
COUNT(technicianAssignedId) AS JobsDone,
MAX(Faults.timeCompleted) AS LastJobTime,
MIN(Technicians.[Zone] - & faultZone &) AS Distance ' MIN has no use
FROM Technicians LEFT OUTER JOIN Faults ON
Technicians.ID = Faults.technicianAssignedID
WHERE Specialization = '" & specialization & "'
`AND Availability = 'available'
GROUP BY Technicians.ID, firstName, lastName, Availability,` Technicians.[Zone], Specialization
ORDER BY 7 DESC"
我有这个来获得绝对值
SELECT CASE
WHEN value < 0 THEN value * -1
ELSE number *1 END
AS VALUE
FROM DB;
现在,具有距离别名的列可能会以负数结束,我需要使用 (* -1) 作为正数,但我不知道如何将它们组合在一起。
谢谢你的帮助