I am trying to develop a query that involves aggregating invoice lines such that values for kits are the sum of their components.
I can see there is a flag (LINTYP_0) to determine what is a kit and what isn't, however I am having a hard time figuring out a way to establish a parent-child relationship between the kit and its components in SQL.
How can this be accomplished?