title: error 1111 (hy000) invalid use of group function when i use count() in group contact
body: <pre><code>select
      `lv_ta30`.`states`.`name` AS `states`,
    group_concat(  DISTINCT 
      CONCAT( `lv_ta30`.`user_groups`.`name` ,' ,',count(`lv_ta30`.`user_groups`.`name`)) 
      
     separator ' ; ') 
  from
      (`lv_ta30`.`user_groups`
  left join (`lv_ta30`.`user_group_affiliations`
  left join (`lv_ta30`.`users`
  left join `lv_ta30`.`states` on
      ((`lv_ta30`.`states`.`id` = `lv_ta30`.`users`.`state_id`))) on
      ((`lv_ta30`.`user_group_affiliations`.`user_id` = `lv_ta30`.`users`.`id`))) on
      ((`lv_ta30`.`user_group_affiliations`.`user_group_id` = `lv_ta30`.`user_groups`.`id`)))
  where
      ((`lv_ta30`.`user_groups`.`id` in (3, 33, 34, 70, 1, 39, 87, 88))
          and (`lv_ta30`.`user_group_affiliations`.`active` = 1)
              and (`lv_ta30`.`user_group_affiliations`.`end_date` &gt; now())
                  and isnull(`lv_ta30`.`user_group_affiliations`.`deleted_at`))
  group BY 
      `states`
  </code></pre>