This 'attach order totals to every user' code silently DROPS sam, who has no orders — inner-join behavior when the population needed a left join. Fix it so every user appears, sam with 0.0.
The break is on line 4 — but read the whole snippet first.
This 'attach order totals to every user' code silently DROPS sam, who has no orders — inner-join behavior when the population needed a left join. Fix it so every user appears, sam with 0.0.