SELECT DATE(A.Inspection_datetime) AS Date,
A.Model,
COUNT(A.Serial_number) AS Qty,
B.Name
FROM inspection_report AS A
LEFT JOIN Employee AS B ON A.NIK = B.NIK
GROUP BY A.Model, A.Serial_number
答案 0 :(得分:5)
猜测(相信我,我猜)
SELECT DATE(A.Inspection_datetime) AS Date,
A.Model,
COUNT(A.Serial_number) AS Qty,
B.Name
FROM inspection_report AS A
LEFT JOIN Employee AS B ON A.NIK = B.NIK
GROUP BY A.Model, B.Name
您需要按照您未聚合的字段进行分组