select m.area_id m.area_code m.analytic_code m.area m.area_en (select count(*) from abstract_service a where a.area_id=m.area_id) as as_cnt (select count(*) from abstract_service a join service s on (a.abstract_service_id=s.abstract_service_id) where a.area_id=m.area_id) as svc_cnt from area m where 1=1 order by select count(*) as cnt from area where 1=1 Группы услуг title="редактировать" class="edit"title="просмотр" class="view"> #gridFooter#