MySQL Forums
Forum List  »  Newbie

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

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.