➥ SELECT browser, as COUNT

SELECT browser, COUNT(browser) AS freq FROM
(SELECT
CASE
  WHEN useragent LIKE '%Chrome%' THEN 'Chrome'
  WHEN useragent LIKE '%Safari%' THEN 'Safari'
  WHEN useragent LIKE '%Firefox%' THEN 'Firefox'
  WHEN useragent LIKE '%MSIE 7%' THEN 'IE7'
  WHEN useragent LIKE '%MSIE 8%' THEN 'IE8'
  WHEN useragent LIKE '%MSIE 9%' THEN 'IE9'
  WHEN useragent LIKE '%MSIE 10%' THEN 'IE10'
  WHEN useragent LIKE '%rv:11%' THEN 'IE11'
  ELSE 'Other'
 END browser
 FROM loginhistory) AS browsers
GROUP BY browser
ORDER BY freq DESC