高分求:SQL解决办法 select t.*,level from table tstart with b='0000'connect by prior b=a 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样写更清晰一点吧.select t.b,level from table tstart with b='0000'connect by prior b=aorder by level,b select 本级部门from 表connect by prior 本级部门=上级部门start with 上级部门='0000'; SQL> select * from t;ID PID---- ----0000 0001 00000002 00000003 00000011 00010012 00010021 00020022 00020031 00030032 00030033 000311 rows selectedSQL> select id from t start with id = '0000' connect by pid = prior id;ID----0000000100110012000200210022000300310032003311 rows selectedSQL> select id,level from t start with id = '0000' connect by pid = prior id;ID LEVEL---- ----------0000 10001 20011 30012 30002 20021 30022 30003 20031 30032 30033 311 rows selected oracle 存储过程的问题,希望哪位大虾解释一下。 各位大虾帮忙,急急急。。。。。 使用plsql创建数据库时总是出错 oracle存储过程操作相邻记录 这样写不对吗?(关于PL/SQL的) 创建表空间的问题 弱弱的求一个很简单的查询语句,可我就是不会!!! 这个是不是过程被加密的提示? 我的MANAGEMENTSERVER服务启动不了, oracle 相邻行某字段相同的行取时间最新的 有没有实现把空字符自动变为0的oracle函数???急~~~~~~~~ 求一SQL语句
select t.b,level from table t
start with b='0000'
connect by prior b=a
order by level,b
from 表
connect by prior 本级部门=上级部门
start with 上级部门='0000';
---- ----
0000
0001 0000
0002 0000
0003 0000
0011 0001
0012 0001
0021 0002
0022 0002
0031 0003
0032 0003
0033 000311 rows selectedSQL> select id from t start with id = '0000' connect by pid = prior id;ID
----
0000
0001
0011
0012
0002
0021
0022
0003
0031
0032
003311 rows selectedSQL> select id,level from t start with id = '0000' connect by pid = prior id;ID LEVEL
---- ----------
0000 1
0001 2
0011 3
0012 3
0002 2
0021 3
0022 3
0003 2
0031 3
0032 3
0033 311 rows selected