Leetcode 608. 树节点(case when)

2021-04-28 11:42:00 浏览数 (1)

代码语言:javascript复制
select id,
    case when p_id is null then 'Root'
         when id in (select p_id from tree) then 'Inner'
         else 'Leaf' end type
from tree

0 人点赞