I have a table with fields like total_expense,material, business_name, etc. Now I want sum(total_expense) where the first grouping is to be done on the basis of material and then on business_name. How can I do that?
Solved! Go to Solution.
Do you mean that you need to group by on the combination of material and business_name? If so just group by with material and business_name in script,
sum(total_expense) as expense_total
group by material, business_name;