易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL Server 2005 CTE的用法

if object_id('[tb]') is not null
drop table [tb] 
go
create table [tb]([id] int,[col1] varchar(8),[col2] int) 
insert [tb] 
select 1,'河北省',0 union all
 select 2,'邢台市',1 union all
 select 3,'石家庄市',1 union all
 select 4,'张家口市',1 union all
 select 5,'南宫',2 union all 
select 6,'坝上',4 union all
  select 7,'任县',2 union all
 select 8,'清河',2 union all 
select 9,'河南省',0 union all
 select 10,'新乡市',9 union all
 select 11,'aaa',10 union all
 select 12,'bbb',10  
 
 ;with t as( 
select * from [tb] where col1='河北省'  union all  select a.* from [tb] a  ,t where a.col2=t.id   
)
 
 select * from t


相关文档:

SQL Server和MySQL中Top用法的区别

      今天练习在JSP页面中实现分页效果,在查询语句方面牵扯到了top的用法。简要做一下总结:
      为实现类似top的功能,我们在SQL Server中和MySQL中使用到的SQL语句是不同的。
      1、在SQL Server中,我们使用  select top N * ......

Sql Server 查询sql执行各个阶段的时间

Sql Server 查询sql执行各个阶段的时间
set statistics io on
set statistics time on
set statistics profile on
go
[你的sql语句]
go
set statistics io off
set statistics time off
set statistics profile off

我运行:
set statistics io on
set statistics time on
set statistics profile on ......

SQL Server 2005中的CLR(2)

文章导航 SQL Server 2005 学习笔记系列文章导航
       这一节咱们来说说ClR的性能,我们不能只使用它而不去考虑到低 为什么要使用它或是在什么时候应该使用它,像我之前写的函数得到一个字符的长度的方法就没有太大必要了,但如果是像拆分字符这样的方法应该就有必要了,比如c#里的Split ......

PL/SQL developer将excel数据导入Oracle

准备工作:数据清洗。检查数据类型和表中的字段类型是否匹配;检查空值约束;去无关空格等。这些检查工作可以通过Excel的数据筛选功能,看一下每个字段所有的值,再选中不合规范的进行修改。   
    步骤:
1)登录pl/sql developer,登录时选择待导入表所在数据库,在查询窗口里输入sele ......

SQL Server 2005 服务器角色和数据库角色名全解

SQL Server 2005 服务器角色和数据库角色名全解
/*服务器角色*/
sysadmin
--在 SQL Server 中进行任何活动。该角色的权限跨越所有其它固定服务器角色。
serveradmin
--配置服务器范围的设置。
setupadmin
--添加和删除链接服务器,并执行某些系统存储过程(如 sp_serveroption)。
securityadmin
--管理服务器 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号