I have sql query that returns total counts by name.
Select distinct name_title, count(name_title)
from table_name
These returns:
Name_title Count
a 3
b 10
c 5
d 4
I need to further work the data by grouping them by Name_Title column:
when Name_title in('a','b') then sum(count(name_title)) end as dept1
when Name_title in('c','d') then sum(count(name_title)) end as dept2
the desired output:
name_title count
dept1 13
dept2 9
any assistant or direction greatly appreciated.