解决方案 »
- SQL 求助
- 散分啦
- 高级复制问题 ORA-04067: 未执行, stored procedure
- Oracle9i使用透明网关连接sqlserver2005,出现错误,在线急等!!
- 打了patch9.2.0.5.0 for 32-Bit windows后不能导出。。
- 触发器问题
- oracle select ...into 与 insert ...select 有何区别?
- 急求 Oracle 10.1.2升级到10.2的patch
- 求救!关于INSERT INTO一个数据集的问题
- oracle Sql语句高级编写
- 跪求牛人oracle查询出重复数据显示为空算出小计的oracle语句
- 如何保证 insert 唯一?
select * from course start with id=( select id from course where 科目 in ('course1'))
connect by id=prior 前置ID union all
select * from course start with id=( select id from course where 科目 in ('course1'))
connect by prior id= 前置ID);
不过我已经在其他地方知道了。select ID,科目,前置id
from course
start with 科目='Course4'
connect by nocycle prior id=前置id or prior 前置id=id
order by id但还是要谢谢你!
(
SELECT '4' id,'Courese1' Courese,' ' qzid FROM dual union all
SELECT '5' id,'Courese2' Courese,'4' qzid FROM dual union all
SELECT '6' id,'Courese3' Courese,'5' qzid FROM dual union all
SELECT '7' id,'Courese4' Courese,'6' qzid FROM dual
)
select level,e.* from a e start with e.Courese='Courese2' connect by e.id= prior e.qzid
order by level desc 不知道这个是不是能够满足你
不过我已经在其他地方知道了。select ID,科目,前置id
from course
start with 科目='Course4'
connect by nocycle prior id=前置id or prior 前置id=id
order by id但还是要谢谢你!
你要实现的是什么?.
根据你的sql实现的是WITH a AS
(
SELECT '4' id,'Courese1' Courese,' ' qzid FROM dual union all
SELECT '5' id,'Courese2' Courese,'4' qzid FROM dual union all
SELECT '6' id,'Courese3' Courese,'5' qzid FROM dual union all
SELECT '7' id,'Courese4' Courese,'6' qzid FROM dual
)
select e.* from a e start with e.Courese='Courese3' connect by nocycle prior e.id=e.qzid or prior e.qzid=e.id
order by id
显示的是
6 Courese3 5