Sql Server cross apply和outer apply
with result as(
select t.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t
cross apply
(select t2.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t2
where t.str = t2.str) t3)
select * from result;
go with result as(
select t.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t
outer apply
(select t2.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t2
where t.str = t2.str) t3)
select * from result;
go select t.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t
cross apply
(select t2.str from(
select '' str
union all
select '' str
union all
select '' str
union all
select '' str
) t2
where t.str = t2.str) t3;
go
Sql Server cross apply和outer apply的更多相关文章
- sql server cross/outer apply 用法
这是 sql server 帮助文档关于apply的描述: 使用 APPLY 运算符(2005或以上版本)可以为实现查询操作的外部表表达式返回的每个行调用表值函数.表值函数作为右输入,外部表表达式作为 ...
- SQL Server连接查询之Cross Apply和Outer Apply的区别及用法(转载)
先简单了解下cross apply的语法以及会产生什么样的结果集吧!示例表: SELECT * FROM tableA CROSS APPLY tableB 两张表直接连接,不需要任何的关联条件,产生 ...
- <转>SQL Server CROSS APPLY and OUTER APPLY
Problem SQL Server 2005 introduced the APPLY operator, which is like a join clause and it allows joi ...
- SQL Server中CROSS APPLY和OUTER APPLY应用
1.什么是Cross Apply和Outer Apply ? 我们知道SQL Server 2000中有Cross Join用于交叉联接的.实际上增加Cross Apply和Outer Apply是用 ...
- SQL Server 关于CROSS APPLY 和 OUTER APPLY应用
先看看语法: <left_table_expression> {cross|outer} apply<right_table_expression> 再让我们了解一下appl ...
- SQL SERVER使用 CROSS APPLY 与 OUTER APPLY 连接查询
概述 CROSS APPLY 与 OUTER APPLY 可以做到: 左表一条关联右表多条记录时,我需要控制右表的某一条或多条记录跟左表匹配的情况. 有两张表:Student(学生表)和 S ...
- SQL 关于apply的两种形式cross apply 和 outer apply
SQL 关于apply的两种形式cross apply 和 outer apply 例子: CREATE TABLE [dbo].[Customers]( ) COLLATE Chinese_PRC_ ...
- SQL 关于apply的两种形式cross apply 和 outer apply(转)
转载链接:http://www.cnblogs.com/shuangnet/archive/2013/04/02/2995798.html apply有两种形式: cross apply 和 oute ...
- SQL关于apply的两种形式cross apply和outer apply(转载)
SQL 关于apply的两种形式cross apply 和 outer apply apply有两种形式: cross apply 和 outer apply 先看看语法: <lef ...
- 转:SQL 关于apply的两种形式cross apply 和 outer apply
原文地址:http://www.cnblogs.com/Leo_wl/archive/2013/04/02/2997012.html SQL 关于apply的两种形式cross apply 和 out ...
随机推荐
- JSONArray ja = JSONArray.fromObject(list);//特殊类 用于将list转化为JSON 数据并返回 out.print(ja);
JSONArray ja = JSONArray.fromObject(list);//特殊类 用于将list转化为JSON 数据并返回out.print(ja);
- mac系统下配置aapt环境变量
在当前用户目录下新建.bash_profile文件,执行以下命令: vi .bash_profile 然后保存,输入命令 :wq 最后使命令生效,执行命令 source .bash_profile
- Python3中 对local和nonlocal 关键字的改善认识(新手向)
nonlocal关键字用来在函数或其他作用域中使用外层(非全局)变量. nonlocal用于声明,修改嵌套作用域(enclosing 作用域,外层非全局作用域)中的变量,如下实例: #!/usr/bi ...
- hdu1584(状态压缩DP)
蜘蛛牌 Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- 《Image-to-Image Translation with Conditional Adversarial Networks》论文笔记
出处 CVPR2017 Motivation 尝试用条件GAN网络来做image translation,让网络自己学习图片到图片的映射函数,而不需要人工定制特征. Introduction 作者从不 ...
- EF 连接MySql
使用EntityFramework6连接MySql数据库(db first方式) http://www.cnblogs.com/24la/archive/2014/04/03/ef6-mysql.ht ...
- UVA1437 String painter
传送门 我们先考虑从一个空白串变成\(B\),这样的话用区间dp,区间dp,设\(f[l][r]\)表示区间\((l,r)\)的最小次数,当\(l==r\)时为\(1\),当\(s[l]==s[r]\ ...
- apicloud运行机制
1 首先在官网apicloud中,创建项目生成config.xml文件,预设风格. 2 将config.xml文件放在项目跟目录中,Vue项目,必须先打包生产dist文件, 3 本地或者云编译(官方工 ...
- _bzoj1208 [HNOI2004]宠物收养所【Splay】
传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1208 以后在空间限制允许的情况下我绝对不纠结内存占用问题啦!就因为不舍得用long long ...
- Matlab实现Hough变换检测图像中的直线 分类: 图像处理 2014-06-14 22:07 641人阅读 评论(0) 收藏
Hough变换的原理: 将图像从图像空间变换至参数空间,变换公式如下: 变换以后,图像空间与参数空间存在以下关系: 图像空间中的一点在参数空间是一条曲线,而图像空间共线的各点对应于参数空间交于一点的各 ...