这是我收到的错误:在选择列表中无效,因为它不包含在聚合函数或 GROUP BY 子句中。
当我编程时
SELECT prod.LineNumber ,
"Pounds Made" = SUM(prod.PoundsMade) ,
"Down Time" = SUM(prodDown.DownTimeHrs + DownTimeMins / 60) ,
prodDown.LineNumber ,
availHrs.LineNumber ,
"Available Hours" = SUM(availHrs.AvailableHRS)
FROM rpt_Line_Shift_Prod AS prod
INNER JOIN rpt_Line_Shift_ProdDownTime AS prodDown
INNER JOIN rpt_LINE_Shift_AvailableHrs AS availHrs ON prodDown.LineNumber = availHrs.LineNumber ON prodDown.LineNumber = prod.LineNumber
--ON availHrs.LineNumber = prod.LineNumber
GROUP BY prod.LineNumber
我在这里使用了三个表,我将它们重命名为 prodDown、prod 和availHrs。
谢谢你!