1SELECT areas.name AS aname, COUNT(consultants.active) AS cct
2 FROM areas
3 LEFT JOIN consAreas
4 ON consAreas.area = areas.id
5 LEFT JOIN consultants
6 ON consultants.id = consAreas.cons
7 WHERE areas.areaID = $area
8 AND consultants.active = 1
9GROUP BY areas.name
10ORDER BY areas.name
11