(this is a simplified version of the real problem) I have a database that contains all the sales of the year. Each row here contains: group, sub_group, sub_sub_group (yes! 3th levels), article_id, quantity;
这里的目标是在2003年进入时提交报告,届时我按小组、分组和分组获得所有记录。 但是,每当次分组结束时,我都需要该次分组所载所有条款的总和。 分组和小组也必须这样做。
What I ve done is to create 3 views: a totalizers view for sub_sub_group, sub_group and group. Then I join all that together, but that is not working as expected (of course!) because they are not in order. (notice: in the article_id for the sub_sub_group I ve wrote the string "sub_sub_total", and the same for sub_group and group) (that worked when I only made the totalizers for the sub_sub_group but not for sub_group and group)
Any advice? thanks ;)