group rows when row count exceeds certain count
This would be fairly straight forward if MySQL had implemented window functions or CTEs (they are working on it but it hasn't been announced yet in which version it will appear.) With a CTE:

with grp as
  ( select city.name, sum(count) as views 
    from profpostview as ppview
      inner join professional as prof 
        on prof.pfid = ppview.viewerpfid
      left join cityinfo as city 
        on city.cityid = prof.cityid
    where pfpid = _pfpid 
    group by city.name
  ),
the_first_three as
  ( select name, views
    from grp
    order by views desc
    limit 3
   ),
the_rest as
  ( select name, views
    from grp
    order by views desc
    limit 900000000000000 offset 3
   )
select name, views
from the_first_three

union all 

select 'other', sum(views)
from the_rest 

order by (name = 'other'), views desc ;


With CTEs and window functions:

with grp as
  ( select city.name, sum(count) as views,
           row_number() over (order by sum(count) desc) as rn 
    from profpostview as ppview
      inner join professional as prof 
        on prof.pfid = ppview.viewerpfid
      left join cityinfo as city 
        on city.cityid = prof.cityid
    where pfpid = _pfpid 
    group by city.name
  )
select name, views, rn
from grp
where rn &lt;= 3

union all 

select 'other', sum(views), 4
from grp
where rn &gt; 3 

order by rn ;


And while we are waiting for CTEs and window functions to be implemented, in current MySQL versiosn, we'll have to either duplicate code or use some trickery to avoid duplication. In any case, I don't think we can avoid doing the group by and summation twice. Here is one way to get the wanted output. It's essentially a rewrite of the above code 1, using derived tables instead of CTEs:

  ( select city.name, sum(count) as views 
    from profpostview as ppview
      inner join professional as prof 
        on prof.pfid = ppview.viewerpfid
      left join cityinfo as city 
        on city.cityid = prof.cityid
    where pfpid = _pfpid 
    group by city.name
    order by views desc
    limit 3
  )
union all   
  ( select 'other', sum(views)
    from 
      ( select city.name, sum(count) as views 
        from profpostview as ppview
          inner join professional as prof 
            on prof.pfid = ppview.viewerpfid
          left join cityinfo as city 
            on city.cityid = prof.cityid
        where pfpid = _pfpid 
        group by city.name
        order by views desc
        limit 900000000000000 offset 3
      ) grp
  )  
order by (name = 'other'), views desc ;


If you want to resolve ties in some way, change the order by accordingly, eg. to order by views desc, name asc