oracle in 空值替换,【学习笔记】测试not in或not exists对连接列有空值的处理方法...

【学习笔记】测试not in或not exists对连接列有空值的处理方法

时间:2016-11-02 20:13   来源:Oracle研究中心   作者:HTZ   点击:

天萃荷净

Oracle研究中心学习笔记:分享一篇关于SQL语句在连接查询时遇到列值有空值的处理方法,测试not in或not exists对连接列有空值的案例。

1,环境介绍

oracleplus.net> select * from v$version where rownum=1;

BANNER

——————————————————————————

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production

oracleplus.net> !uname -a

Linux orcl9i 2.6.9-89.EL #1 Mon Apr 20 10:22:29 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

oracleplus.net> @parameter_hide.sql

oracleplus.net> set echo off

Enter Search Parameter (i.e. max|all) : _optimizer_null_aware_antijoin

PARAMETER SESSION_VALUE INSTANCE_VALUE DESCRIPTION

—————————————- ——————– ——————– —————————–

_optimizer_null_aware_antijoin TRUE TRUE null-aware antijoin parameter

2,创建测试环境

oracleplus.net> create table htz.ht1 (id number,name varchar2(10));

Table created.

oracleplus.net> create table htz.ht2 (id number,name varchar2(10));

Table created.

oracleplus.net> insert into htz.ht1 values (1,’htz1′);

1 row created.

oracleplus.net> insert into htz.ht2 values (1,’htz1′);

1 row created.

oracleplus.net> insert into htz.ht2 values (2,’htz2′);

1 row created.

oracleplus.net> insert into htz.ht1 values (2,’htz2′);

1 row created.

oracleplus.net> insert into htz.ht1 values (3,’htz3′);

1 row created.

oracl

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值