608 Tree Node

select id,

case when p_id is null then 'Root '

  when id in (select distinct p_id from tree where p_id is not null) then 'Inner'

  else 'leaf' end Type 

from tree

order id

 

posted @ 2018-10-22 11:29  ffeng0312  阅读(156)  评论(0编辑  收藏  举报