SAP/Manufacturing 级别任务。 **条件:** 计算每个最终产品的全部成本,包括所有组件和子组件,并考虑数量。 **表:** components (component_id, name, parent_id, unit_cost, quantity) **要求:** 1. 递归遍历组件树 2. 在每个级别将 unit_cost 乘以 quantity 3. 汇总所有组件的成本 4. 为最终产品输出 (parent_id IS NULL): name, total_cost **提示:** 在递归中累积
登录后解题
开始解题