游标遍历


select count(1)
from (select level l
from t_mps_dfs_file f
where 1 = 1
and f.owner = '112'
and f.status = '0'
start with f.id = 3
CONNECT by prior f.id = f.pid) t
where t.l <= 2

 


select *
from (select level l, f.*
from t_mps_dfs_file f
where 1 = 1
and owner = '112'
and status = '0'
start with f.pid = 0
CONNECT by prior f.id = f.pid) t
where t.l <= 2
order by t.l,t.id

posted @   wangfg  阅读(137)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示