首页 > 其他 > 详细

游标遍历

时间:2016-01-11 12:00:47      阅读:276      评论:0      收藏:0      [点我收藏+]


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

游标遍历

原文:http://www.cnblogs.com/wangfg/p/5120500.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!