1. Find the score of the grouping in table an and sort it
2.
a Table
id
openid
groups grouping
b Table
id
openid
step score
openid is the associated field of two tables
3. Get the sum of groups grouping corresponding to step scores in table b sorted by groups