remove duplicated group-by clause