Re: MySQL Rollup - All possible column super aggregations
Posted by:
Rathi Rao
Date: June 05, 2017 01:29AM
Hi Peter, That was a fantastic solution.
However, it has solved my problem partly
select
itemtypeid,unitid,concat(itemtypeid,'-',dealerid)itemdealer,concat(itemtypeid,'-',districtid)itemdistrict,group_concat(num)nums,
sum(num)
from testrollup
where itemtypeid = 100 and unitid =10
group by itemtypeid,unitid,dealerid,itemdealer,itemdistrict with rollup;
What I want to have is the summation for itemdistrict , it still gets split because of itemdealer. I just want it to be independent of it.
All items in a district. All items for a dealer. How do I achieve this?
Is there any way I can post pictures of data, I can be more clear in explaining.
Thanks
Rathi