Using this query, my output includes all values where COUNT is 0, but I still get the warning that Null values have been not been included. The double joins are to get the tables linked appropriately to count the number of orders, but I want to include all NULL as well, not just where COUNT is 0. What am I missing?
SELECT EmpNo, LastName, COUNT(CustomerOrder.OrderNo)
FROM Employee
LEFT OUTER JOIN Customer
ON Customer.AcctRepNo = EmpNo
LEFT OUTER JOIN CustomerOrder
ON Customer.CustNo =CustomerOrder.CustNo
GROUP BY EmpNo, LastName
ORDER BY COUNT(CustomerOrder.OrderNo) DESC, LastName
The results are fine, it is including all your values. The message it’s only saying that when the column
CustomerOrder.OrderNois null, then it is not counting them (hence, the count value of zero).