美文网首页
oracle 树状查询

oracle 树状查询

作者: SecondRocker | 来源:发表于2018-07-22 23:21 被阅读11次

有时候表的里存储的树状结构,如categories表里 有以下字段:
id,name,parent_id

查询某个数据的所有下级数据(包括自己、子数据和子数据的自数据..)
select * from categories start with id = xx
connect by prior id = parent_id
where conditions

相关文章

网友评论

      本文标题:oracle 树状查询

      本文链接:https://www.haomeiwen.com/subject/boormftx.html