SQL 迭代查询语句
Posted Twang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SQL 迭代查询语句相关的知识,希望对你有一定的参考价值。
SQL迭代查询 PL/SQL
with ORG_Tree(ObjectId,parentID) as ( select a.ObjectId,a.parentID from Ot_Organizationunit a where Name in (‘212江苏区域‘,‘225浙江区域‘,‘260苏州区域‘,‘217沪苏区域‘) Union ALL select b.ObjectId,b.parentID from Ot_Organizationunit b inner join ORG_Tree T on b.parentID=T.ObjectID ) select ouser.Name,ouser.code from OT_User ouser inner join ORG_Tree ot on ouser.parentid=ot.ObjectID
以上是关于SQL 迭代查询语句的主要内容,如果未能解决你的问题,请参考以下文章