Thanks for sharing. Not knowing the entire structure of your table, it would seem that you want to group by the parent reference field (e.g. u_parent?) not the number. You are summing up the records that have that in common, right?