惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
Cisco Talos Blog
Cisco Talos Blog
AI
AI
L
LINUX DO - 最新话题
H
Heimdal Security Blog
Hacker News: Ask HN
Hacker News: Ask HN
Webroot Blog
Webroot Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
The GitHub Blog
The GitHub Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
S
Securelist
博客园_首页
IT之家
IT之家
Schneier on Security
Schneier on Security
博客园 - 叶小钗
罗磊的独立博客
WordPress大学
WordPress大学
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
MongoDB | Blog
MongoDB | Blog
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
The Register - Security
The Register - Security
D
DataBreaches.Net
S
Security @ Cisco Blogs
Security Archives - TechRepublic
Security Archives - TechRepublic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
Recorded Future
Recorded Future
NISL@THU
NISL@THU
N
News and Events Feed by Topic
T
Tailwind CSS Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
T
Tor Project blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com

博客园 - 骑着夕阳看着猪

asp.net mvc 中hmtl.xxxx是否使用<%=... %> 高版本(vs2008)如何打开低版本解决方案和项目(vs2003、vs2005的项目) 序列化和反序列化 用jquery实现学校的校历 一步一步学jquery UI 1.72 之datepicker - 骑着夕阳看着猪 显示日期是当前区间第几周? - 骑着夕阳看着猪 - 博客园 c# 日期相减 如何使图片在div里上下居中 - 骑着夕阳看着猪 - 博客园 实现qq邮箱换肤(第二季 ) - 骑着夕阳看着猪 - 博客园 实现qq邮箱换肤(第一季 ) 获取元素和鼠标的位置(兼容IE6.0,IE7.0,IE8.0,FireFox2.0,FireFox3.5,Opera) img src='' 为空引发的问题 - 骑着夕阳看着猪 如何清除html图片缓存 - 骑着夕阳看着猪 - 博客园 关于 wcf揭秘 第四章代码运行错误 - 骑着夕阳看着猪 配置SQL Server2005以允许远程访问 SQL Server2005还原数据库详细 初试ajax基础 实现控件的随意拖动 BindingManagerBase的应用
sql 根据父节点查找所有子节点
骑着夕阳看着猪 · 2009-12-30 · via 博客园 - 骑着夕阳看着猪

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go


ALTER   function   f_id(@parentid  int)  
  returns   @re   table(orderid   int,parentid   int,title   nvarchar(50),level   int)  
  as  
  begin  
  declare   @l   int  
  set   @l=0  
  insert @re select @parentid,null,'',-1
  insert   @re   select   TabID,   ParentTabID   ,TabName,@l   from   rb_Tabs  
  where   ParentTabID=@parentid   
  while   @@rowcount>0  
  begin  
  set   @l=@l+1  
                  insert   into   @re   select    
                  a.TabID,a.ParentTabID,a.TabName,@l  
                  from   rb_Tabs   a,@re   b  
                  where   a.ParentTabID=b.orderid   and   b.level=@l-1   
  end  
  return  
  end  
  go  
--------------------------------------------------------------
使用方法

declare @cat int
set @cat  = 406
SELECT
       rb_Products_st.ProductID,
   rb_Products_st.DisplayOrder,
   rb_Products_st.ModelNumber,
   rb_Products_st.ModelName,
   rb_Products_st.UnitPrice,
   rb_Products_st.FeaturedItem,
   rb_Products_st.LongDescription,
   rb_Products_st.ShortDescription,
   rb_Products_st.MetadataXml,
   rb_Products_st.Weight,
   rb_Products_st.TaxRate
  FROM
   rb_Products_st
  WHERE
      rb_Products_st.CategoryID in (select   orderid   from   dbo.f_id(@cat) )