I've got a table:
select personID, categoryCode from entries;
6300936427 083
6314642671 084
6314742066 081
6346724201 083
...
I can count the number of persons in each group by:
select categoryCode, count(e.ID)
from entries e
group by e.categoryCode
order by e.categoryCode;
060 56
062 15
081 377
082 374
I want to do the same calculation, but for some choosen categories I want to count them together. For instance I want if categoryCode IN ('081', '082') I wish to count results for them. And my result set should be calculated as:
select ...
060 56
062 15
080 751 --(377 + 374) counts, that correspond to 081 and 082 categoryGroup
How can I archive this using Oracle analytical functions? (Oracle version 10)