yuyee

oracle中的递归查询

start with .... connect by prior.....,如果prior缺省,则只能查询符合条件的起始行,并不能递归
从root到末梢:select * from permissiontable t start with parentid=1 connect by prior id=parentid
从末梢到root:select * from permissiontable t start with id=32 connect by prior parentid=id

posted on 2010-10-25 15:55 羔羊 阅读(202) 评论(0)  编辑  收藏 所属分类: oracle