Adding a second LEFT JOIN doubled the revenue figure on a report. Explain what happened and write the correct query.
Two one-to-many joins from the same parent multiply against each other, so every payment row is counted once per order line. Aggregate each branch to one row per parent before joining, and reach for DISTINCT only where duplicate values are genuinely impossible.