I have 3 categories:
categories number_units
CAT_A 10
CAT_B 20
CAT_C 30
If I do a GROUP BY for column categories I will get the 3 categories seen above. But if I want to do a case statement like:
SELECT CASE WHEN categories LIKE 'CAT%' ...
(to show the sum of all those that contain CAT it will exclude the groupings like CAT_A, _B, _C)
How can I write a query that will get the following result:
categories sum
CAT 60
CAT_A 10
CAT_B 20
CAT_C 30