Non-Brand Data

Non-Brand Data

Module 9: When a join increases your numbers

Let's learn why a one-to-many join can increase a total and how to keep the number correct.

Cornellius Yudha Wijaya's avatar
Cornellius Yudha Wijaya
Oct 01, 2026
∙ Paid

Previous module: Module 8, Choosing between INNER JOIN and LEFT JOIN.

An order total can be correct in the orders table but become wrong after a join. This happens when one order matches several item rows. SQL repeats the order value on every matched row, and SUM counts every copy.

In this module, we’ll learn how to check the row count after a join. We will also aggregate each child table before joining when the report needs one row per order.


User's avatar

Continue reading this post for free, courtesy of Cornellius Yudha Wijaya.

Or purchase a paid subscription.
© 2026 Cornellius Yudha Wijaya · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture