I have a pretty specific question and I dont know how to approach this.
I have a polygon layer for subbasins in the Danube area (HydroShed) which also contains information for water discharge.
The first picture shows the attribute table. Each subbasin has a "Hybas_ID" which contains information for the Pfafstetter Code. Most of these subbasins have information for downstream neigbours, which is portrayed in the "Next_Down" (showing the Hybas_ID of the specific subbasin it flows into) column.
Some of these subbasins also have more than one upstream neighbour, so for example subbasin "2080452200" and "2080452210" flow into the subbasin "2080453270" (Picture 1). My question is: Can I combine/summarize the water discharge information (column "TD") from the first two subbasin and attach it to the subbasin these two flow into (into a new column i.e.)? This has to be done for every subbasin which has upstream neigbours, is there a possibility/tool or function to do this in one go? There are over 1300 subbasins, so to do it by hand wouldn't really be an option. Unfortunately I'm not really frequent in SQL.