码迷,mamicode.com
首页 > 其他好文 > 详细

608 Tree Node

时间:2018-10-22 12:58:53      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:cas   type   case   tree node   inner   rom   nbsp   lse   null   

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

 

608 Tree Node

标签:cas   type   case   tree node   inner   rom   nbsp   lse   null   

原文地址:https://www.cnblogs.com/ffeng0312/p/9829174.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!