SELECT
p.areaCode
, COALESCE(a.numberOfAgents, 0) AS numberOfAgents
FROM postalAreas AS p
LEFT OUTER JOIN
(SELECT
areaCode
, COUNT(*) as numberOfAgents
FROM agentToPostcode
GROUP BY areaCode
) AS a
ON p.areaCode = a.areaCode
ORDER BY p.areaCode