group by parentid or brand_name