码迷,mamicode.com
首页 > 其他好文 > 详细

递归查询 树结构数据

时间:2014-09-18 18:25:04      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:blog   http   io   数据   2014   sp   log   on   c   

表行业类别的数据

bubuko.com,布布扣

 

查询与 010101 有关的所有上级tree node

with temp as
(
select hybm,hyms,sjhybm,hyjb from dmt_hydm where hybm = 010101
union all
select h.hybm,h.hyms,h.sjhybm,h.hyjb from dmt_hydm h,temp t where h.hybm=t.sjhybm
)
select * from temp order by hyjb

递归查询 树结构数据

标签:blog   http   io   数据   2014   sp   log   on   c   

原文地址:http://www.cnblogs.com/qlbk/p/3979508.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!