tags:

views:

50

answers:

1
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 
+3  A: 

At a guess (and believe me, I'm guessing)

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   

You need to group by the fields you're not aggregating

Binary Worrier
For bonus points, change the alias for Employee from `B` to `Beat`, then you can have a `Beat.Nik` :)
Binary Worrier
For mega bonus points, then change nik to root, then you will have a beat.root which is a tasty and healthy vegetable whose promotion can only better the world.
Tom Gullen