Skip to content
Advertisement

Tag: business-intelligence

How can I write a SQL query to calculate the quantity of components sold with their parent assemblies? (Postgres 11/recursive CTE?)

My goal To calculate the sum of components sold as part of their parent assemblies. I’m sure this must be a common use case, but I haven’t yet found documentation that leads to the result I’m looking for. Background I’m running Postgres 11 on CentOS 7. I have some tables like as follows: And a view like so, which is

Advertisement