[Exam Preparation] Problem 5
Не мога да разбера защо това решение дава 0 точки:
SELECT c.CityName, b.Name, COUNT(*) AS EmployeesCount FROM Cities AS c
JOIN Branches AS b
ON b.CityID = c.CityID
AND b.CityID NOT IN (4,5)
JOIN Employees AS e
ON e.BranchID = b.BranchID
GROUP BY c.CityName, b.Name
HAVING COUNT(*) >= 3
А това решение минава:
SELECT c.CityName, b.Name, COUNT(*) AS EmployeesCount FROM Cities AS c
JOIN Branches AS b
ON b.CityID = c.CityID
JOIN Employees AS e
ON e.BranchID = b.BranchID
WHERE c.CityID NOT IN (4,5)
GROUP BY c.CityName, b.Name
HAVING COUNT(*) >= 3