select * from course where id in(
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); ------解决方案--------------------
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 level,e.* from a e start with e.Courese='Courese2' connect by e.id= prior e.qzid
order by level desc
不知道这个是不是能够满足你 ------解决方案--------------------
你要实现的是什么?.
根据你的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&n