递归查询

select * from  lacom a  where banktype='02'  start with a.agentcom='0202081584'   Connect by prior a.upagentcom=a.agentcom ;

递归调用的用法:

select  level,a.* from lacom a  start with  a.agentcom='0501010101001'  connect by           a.agentcom= prior a.upagentcom; --  自底向上
select level,a.* from lacom a  start with  a.agentcom='0501'           connect by    prior a.agentcom= a.upagentcom ;  --  自顶向下

posted @ 2017-01-06 18:00  洋流季  阅读(166)  评论(0编辑  收藏  举报