`

sqlserver 2008 start with connect by 实现

 
阅读更多
with subqry(id,name,parent_id) as(
  select id,name,parent_id from pro_type_manage where id in ('5799936','5799946')  -- start with
  union all
  select test1.id,test1.name,test1.parent_id from pro_type_manage as test1,subqry
  where test1.parent_id = subqry.id --connect by
  )
  select* from subqry;
分享到:
评论

相关推荐

    微软内部资料-SQL性能优化3

    To support SERIALIZABLE transaction semantics, SQL Server needs to lock sets of rows specified by a predicate, such as WHERE salary BETWEEN 30000 AND 50000 SQL Server needs to lock data that does ...

    SQL21日自学通

    Microsoft and Sybase SQL Server 171 Personal Oracle7171 总结172 问与答172 校练场173 练习173 第九天创建和操作表174 目标174 CREATE DATABASE 语句174 建立数据库时的选项175 设计数据库176 建立数据字典176 ...

    Raspberry Pi Zero Cookbook

    Edward Snajder takes on the challenges of performance, optimization, scalability, and portability for PostgreSQL, Oracle, SQL Server, and MySQL DB engines for the databases behind the Jive platform....

    Citrix_XenApp5

    • Citrix provides a 96-hour initial grace period that will allow up to two users to connect while unable to connect to a License Server • Citrix XenApp client • the XenApp Plugin,the XenApp Web ...

    Learning PostgreSQL 10

    We’ll cover the Data Definition Language (DDL) with an emphasis on PostgreSQL, and the common DDL commands supported by ANSI SQL. You’ll learn to create tables, define integrity constraints, build ...

    韩顺平oracle学习笔记

    案例:sql>@ d:\a.sql 或者 sql>start d:a.sql (2) edit 说明:该命令可以编辑指定的sql脚本。 案例:sql>edit d:\a.sql (3) spool 说明:该命令可以将sql*plus屏幕上的内容输出到指定文件中去。 案例:sql>spool d:...

    最全的oracle常用命令大全.txt

    SQL>START test SQL>@test 常用SQL*Plus语句 a、表的创建、修改、删除 创建表的命令格式如下: create table 表名 (列说明列表); 为基表增加新列命令如下: ALTER TABLE 表名 ADD (列说明列表) 例:为test表...

    (3.0版本)自己写的struts2+hibernate+spring实例

    mysql和sqlserver不知道有没有start with这个sql. jar包:项目中除了使用了struts2,hibernate3.0和spring1.8以外(用spring2.0的包也可以.不能低于1.8的包.)还是用了junit,ajax,第三方的table组件.等等.所以需要下载...

    php.ini-development

    Instead, explicitly set the output handler using ob_start(). ; Using this ini directive may cause problems unless you know what script ; is doing. ; Note: You cannot use both "mb_output_handler" with...

    oracle学习文档 笔记 全面 深刻 详细 通俗易懂 doc word格式 清晰 连接字符串

    SQL> grant connect,resource to admin;  撤销角色的权限 SQL> revoke connect from admin;  删除角色 SQL> drop role admin;   第三章 Sql查询与函数 一、 SQL概述 SQL(Structured Query Language)结构化查询...

    测试培训教材

    安装好SQL Server 2000后注意启动SQLServer服务器 3、安装QC9.0 服务器名称也可以是IP地址 4、启动QC9.0 5、QC9.0安装问题解决 - JBOSS启动不...

    Oracle 主要配置文件介绍

    sqlnet.ora 和 tnsnames.ora 文件之后 就可以用以下命令将监听文件中定义的监听器启动 起来 $ lsnrctl start 停止监听器的命令为 $ lsnrctl stop 监测监听器当前状态的命令为 $ lsnrctl ...

    21天学习SQL V1.0

    21天学习SQL V1.0.pdf 66 SQL 21 日自学通(V1.0) 翻译人笨猪 EMAIL wyhsillypig@163.com 2 日期/时间函数.........................................................................................................

    ZendFramework中文文档

    实现订制存储 3.1.4. 使用Zend_Auth 3.2. 数据库表认证 3.2.1. 简介 3.2.2. 高级使用:持久一个 DbTable 结果对象 3.2.3. 高级用法示例 3.3. 摘要式认证 3.3.1. 简介 3.3.2. 规范(Specifics) 3.3.3. ...

    ehlib_vcl_src_9_3.26

    Start overview of the library with the main Demo project .\Demos\Bin\MainDemo.Exe. (Compiled Demo files are available in the Evaluation version of the library) If you've used previous versions of the...

    EhLib 9.1.024

    Start overview of the library with the main Demo project .\Demos\Bin\MainDemo.Exe. (Compiled Demo files are available in the Evaluation version of the library) If you've used previous versions of the...

    EhLib 6.3 Build 6.3.176 Russian version. Full source included.

    (for application) event which it is necessary to write to execute SQL expressions on the server. TBDEDataDriverEh, TIBXDataDriverEh, TDBXDataDriverEh and TADODataDriverEh Components. These are ...

    EhLib 8.0 Build 8.0.023 Pro Edition FullSource for D7-XE8

    Start overview of the library with the main Demo project .\Demos\Bin\MainDemo.Exe. (Compiled Demo files are available in the Evaluation version of the library) Then you can read a summary of the new ...

    EhLib5.0.13 最新的ehlib源码

    (for application) event which it is necessary to write to execute SQL expressions on the server. TBDEDataDriverEh, TIBXDataDriverEh, TDBXDataDriverEh and TADODataDriverEh Components. These are ...

Global site tag (gtag.js) - Google Analytics