with cte as
(
select parent,body from table1 where parent = ""
union all
select t.parent,t.body from cte c inner join table1 t
on c.body = w.parent
)
select a.parent,a.body,b.body from cte a
left join cte b on a.body = b.parent
left join cte c on b.body = c.parent
where a.parent=""