Home > Database > Mysql Tutorial > body text

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

WBOY
Release: 2016-06-07 16:19:12
Original
1154 people have browsed it

-- ||是连接符,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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!