sql - Combining countries in a region and displaying it on the same column -


is there way combine countries groups , displaying them in same output column? don't want manipulate raw database.

e.g.

  • austria 10
  • belgium 30
  • switzerland 25

now at, be, ch group-1 countries, , in output want display below:

  • austria 10
  • belgium 30
  • switzerland 25
  • group-1 65

select country_name, val country_table union select 'group-1' country_name, sum(val) val country_table 

you should add grouping , union both queries.


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -