SQLServer2008 表连接时null 和 null 无法匹配?
来源:互联网 发布:网络销售犯罪的特征有 编辑:程序博客网 时间:2024/06/05 05:10
例如
select * from tbl_a a
left join tbl_b b on b.docno=a.docno and b.project=a.project
where a.docno='xxx'
发现a的project列和b的project列都为 null
于是匹配不到值
最后改为:
select * from tbl_a a
left join tbl_b b on b.docno=a.docno and isnull(b.project,0)=isnull(a.project,0)
where a.docno='xxx'
即可
0 0
- SQLServer2008 表连接时null 和 null 无法匹配?
- “”和null
- "=NULL"和"Is NULL"
- null和"null"的区别
- hive中null和'','NULL'
- mysql null和not null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- null
- Codeforces 366B Dima and To-do List 【模拟】
- windows 装XP系统
- Foeach 时修改集合的值报错
- linuxrw
- 亲爱的程序猿们怎么找工作
- SQLServer2008 表连接时null 和 null 无法匹配?
- SQLServer2008 关于while循环
- 第5周项目1-(2)
- Aspose.Cells 使用汇总
- [转]IOS开源项目组件
- JAVA多线程和并发基础面试问答
- [转]接口和抽象类
- Windows7添加路径到path环境变量
- Java中Ajaxa中文乱码问题