`
672627493
  • 浏览: 17048 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

start with ...connect by ... prior ...的使用方法

阅读更多

--从根查到叶
select * from t_table_shu t start with t.id = 1 connect by prior t.id =  t.parent_id;
--从叶查到跟
select * from t_table_shu t start with t.id = 5 connect by prior t.id =  t.parent_id;


prior 指的是一哪一方为根节点为根节点

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics