User452040443 posted
Hi,
Try:
select coalesce(c.Field1, t.Field1) as Field1, sum(t.Field2) as Field2
from MyTable as t
outer apply
(
select l.Field1
from MyTable as l
where l.Field1 like t.Field1 + '/%'
) as c
group by coalesce(c.Field1, t.Field1)
Hope this help