select t.id as id,
when t.p_id is null** then 'Root'
when t.id in (select p_id from tree) then 'Inner'
from tree t;
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.