SQL - 乘以列

SQL - Multiplying columns

我无法让它工作

SELECT PM.PMNUM, (COUNT(ROUTE_STOP.LOCATION) * JOBPLAN.JPDURATION) 
FROM PM
LEFT OUTER JOIN ROUTE_STOP ON ROUTE_STOP.ROUTE = PM.ROUTE
LEFT OUTER JOIN JOBPLAN ON JOBPLAN.JPNUM = PM.JPNUM
GROUP BY PM.PMNUM

正如我所见,您的最小分组依据是。

SELECT PM.PMNUM, (COUNT(ROUTE_STOP.LOCATION) * JOBPLAN.JPDURATION) 
FROM PM
LEFT OUTER JOIN ROUTE_STOP ON ROUTE_STOP.ROUTE = PM.ROUTE
LEFT OUTER JOIN JOBPLAN ON JOBPLAN.JPNUM = PM.JPNUM
GROUP BY PM.PMNUM, JOBPLAN.JPDURATION

如果这没有帮助,您需要提供进一步的反馈是什么不起作用?