Химик, по пробуйте так:
SELECT `uid`, SUM(`balls`) AS `balls_sum` FROM `tab` GROUP BY `uid` ORDER BY `balls_sum` DESC