您好,欢迎访问一九零五行业门户网

Oracle层次查询和with函数的使用示例

-- ||是连接符,level可以看成常量 select t.fnum,lpad(' ',3*level-3)||'|-'||fname fname,t.fparent,level lev from m_depart t --start with后面是条件1 start with fparent is null --connect by prior后面是条件2 connect by prior fnum=fparent
-- ||是连接符,level可以看成常量
select t.fnum,lpad(' ',3*level-3)||'|-'||fname fname,t.fparent,level lev
from m_depart t
--start with后面是条件1
start with fparent is null
--connect by prior后面是条件2
connect by prior fnum=fparent

其它类似信息

推荐信息