SQL for hierarchical cumulative sum, but with cumulative sum of child node modified before used to calculate parent’s cumsum
entityId parentId percentContribution emission emission_locationbased emission_marketbased cumsum_locationbased cumsum_marketbased E1 60 30 60 70 E2 E1 80 20 30 40 E3 E2 80 10 20 10 20 This is a sample of a tree structure in a single table that I’m working on. The table is a hierarchy of entities, each generating a certain amount of […]