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 ...
随机推荐
- I.MX6 查找占用UART进程
/**************************************************************************** * I.MX6 查找占用UART进程 * 说 ...
- Watir: 右键点击实例(某些如果应用AutoIt来做会更加简单高效)
require 'watir' module Watir class Element def top_edge assert_exists assert_enabled ole_object.getB ...
- python的termcolor模块
termcolor是一个python包,可以改变控制台输出的颜色,支持各种terminal(WINDOWS的cmd.exe除外). 它支持下列的文字颜色: grey, red, green, yell ...
- bzoj4276
线段树优化建图+费用流 朴素的做法是每个强盗直接对每个区间的每个点连边,然后跑最大权匹配,这样有5000*5000条边,肯定过不去,那么我们用线段树优化一下,因为线段树能把一个O(n)的区间划分为O( ...
- 80个Python经典资料(教程+源码+工具)汇总——下载目录 ...
原文转自:http://bbs.51cto.com/thread-935214-1.html 大家好,51CTO下载中心根据资料的热度和好评度收集了80个Python资料,分享给Python开发的同学 ...
- DIV居中显示
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- ObjectInputStream与ObjectOutputStream类实现对象的存取
1. ObjectInputStream与ObjectOutputStream类所读写的对象必须实现Serializable接口,对象中的transient和static类型成员变量不会被读取和写入 ...
- Ubuntu 环境变量及 ADB 配置 (转载)
转自:http://blog.csdn.net/ithomer/article/details/7307449 同Windows一样,Ubuntu Linux系统包含两类环境变量:系统环境变量和用户环 ...
- jsp请求转发小例子(转载)
在服务器端对客户端请求时行转发对其它的对象,如果jsp网页或Servlet 用三个 jsp网页来演示转发: forword1.jsp, 用来提交表单, 将表单内容提交给 forwrod2.jsp, ...
- 洛谷 P3731 [HAOI2017]新型城市化【最大流(二分图匹配)+tarjan】
我到底怎么建的图为啥要开这么大的数组啊?! 神题神题,本来以为图论出不出什么花来了. 首先要理解'团'的概念,简单来说就是无向图的一个完全子图,相关概念详见度娘. 所以关于团一般都是NP问题,只有二分 ...