All tied maxima in each group
The shop-wide largest order is not the largest in every status. Find the extreme inside the current order’s group and keep every tied order, not an arbitrary winner.
Compare each row to its own group MAX. Equality keeps every tied extreme; LIMIT 1 on the whole result is not one extreme per group.
- All tied maxima in each group
- Compare each row to its own group MAX. Equality keeps every tied extreme; LIMIT 1 on the whole result is not one extreme per group.