It forgives my English, I am brazileira... As to add the values in groups? Code: Father 1 -------- Son 1 -------- Grandson 1 -------- 5,00 Grandson 2 -------- 5,00 Grandson 3 -------- 5,00 Son 2 -------- Grandson 1 -------- 1,00 Grandson 2 -------- 1,00 Grandson 3 -------- 1,00 I want to add the values above that it is in the following way: Code:[code]Father 1 -------- 18,00 Son 1 -------- 15,00 Grandson 1 -------- 5,00 Grandson 2 -------- 5,00 Grandson 3 -------- 5,00 Son 2 -------- 3,00 Grandson 1 -------- 1,00 Grandson 2 -------- 1,00 Grandson 3 -------- 1,00 sql are grouped by father and son and have only the value of the grandson thanks