2

When you use count and group by in mysql, how do I hide the count column that implicitly shows up in the resulting table?

SELECT name, region, COUNT(*) as num_visits 
  FROM world
    GROUP BY region
      HAVING num_visits > 1

This will display a table with one column as the region and the other as the num_visits to each (given that it was visited more than once).

Is it possible to hide that last column so that only the regions are shown?

Thanks!

DoNotArrestMe
  • 1,285
  • 1
  • 9
  • 20
user1530318
  • 25,507
  • 15
  • 37
  • 48

1 Answers1

10

use the calculated column instead,

SELECT region
FROM   world
GROUP  BY region
HAVING COUNT(*) > 1
John Woo
  • 258,903
  • 69
  • 498
  • 492