SqlServer中关联表on和where后条件是否生效
来源:互联网 发布:求解方程组最优化 编辑:程序博客网 时间:2024/06/01 10:05
环境:Sql Server2008.
inner join on后面跟的直接条件是有效的,同时and后面跟的条件也是有效的;
left/right join on后面跟的直接条件是有效的,但是and后面跟的条件无效的;
left/right join on可以通过where添加过滤条件,where后的条件都是有效的.
SELECT top 2 testDtil.* FROM testMain right join testDtil on testMain.joinhm = testDtil.joinhm where 1=2 ;
SELECT top 2 testDtil.* FROM testMain left join testDtil on testMain.joinhm = testDtil.joinhm and 1=2 ;
SELECT top 2 testDtil.* FROM testMain left join testDtil on testMain.joinhm = testDtil.joinhm where 1=2 ;
SELECT top 2 testDtil.* FROM testMain inner join testDtil on testMain.joinhm = testDtil.joinhm and 1=2 ;
SELECT top 2 testDtil.* FROM testMain inner join testDtil on testMain.joinhm = testDtil.joinhm where 1=2 ;
0 0
- SqlServer中关联表on和where后条件是否生效
- mysql中内连接和外连接on后的条件何时生效说明
- JOIN关联表中ON,WHERE后面跟条件的区别
- SQL中on和where条件的区别
- SQL中ON和WHERE条件的区别
- SQL中ON和WHERE条件的区别
- SQL_left join中on和where条件的区别
- SQL中条件放在on后与where后的区别
- MYSQL联表查询LEFT JOIN 中 WHERE条件放在ON条件里和外部的区别
- MySQL关联left/right+join+on条件与where不同
- MySQL关联left join 条件on与where不同
- MySQL关联left join 条件on与where不同
- MySQL关联left join 条件on与where不同
- MySQL关联left join 条件on与where不同
- MySQL关联left join 条件on与where不同
- MySQL关联left join 条件on与where不同
- SQL中on条件与where条件的区别
- SQL中on条件与where条件的区别[转]
- 最大流算法_Dinic
- linux上安装chm读取软件
- 我们交了那么多年的五险一金退休后到底能拿回多少
- LeetCode -- Distinct Subsequences
- web聊天室连接方式之轮询
- SqlServer中关联表on和where后条件是否生效
- MapReduce实现推荐算法(同现矩阵*评分矩阵=推荐结果)
- Maven 打jar包
- gzip和gunzip
- mongoDB 基本命令整理
- 蜡笔
- 苹果开发 笔记(65)遍历
- noip2003 乒乓球 (模拟)
- 【排障】nagios出现问题connection refused by host