使用 not exists, not in 须小心
来源:互联网 发布:天狗街源码交易 编辑:程序博客网 时间:2024/05/16 19:56
not exists 和 not in 对空值返回结果不同.
product_type_id 为空时,not exists 有返回,而not in没有返回值。
NOT EXISTS:
SELECT product_type_id, nameFROM product_types outerWHERE NOT EXISTS (SELECT 1 FROM products inner WHERE inner.product_type_id = outer.product_type_id);查询结果:
PRODUCT_TYPE_ID NAME--------------- ---------- 5 Magazine
NOT IN:
SELECT product_type_id, nameFROM product_typesWHERE product_type_id NOT IN (SELECT product_type_id FROM products);
查询结果 :no rows selected
- 使用 not exists, not in 须小心
- not in 和not exists的使用
- Note3 : EXISTS、NOT EXISTS、IN、NOT IN使用
- IN, EXISTS, NOT IN, NOT EXISTS
- in、not in、exists、not exists
- exists,in 和 not in ,not exists
- IN/NOT IN---EXISTS/NOT EXISTS理解
- in、exists、not in、not exists
- oracle in,exists,not in,not exists
- in,exists,not in ,not exists效率
- Exists,not Exists,in,not in
- in、exists、not in、not exists
- mySql:in,exists,not exists
- not in/not exists+null
- not in不等于not exists
- not exists不等于not in
- not exists 和not in
- not in 和 not exists
- 剖析 Linux hypervisor
- POJ 2949 SPFA
- 最小循环节
- javascript的Foreach语法
- struct kref
- 使用 not exists, not in 须小心
- 走迷宫
- 读书笔记——数据结构(1)开篇吐槽
- 70个城市房价上涨,令人忐忑
- 关于配置到dbca输入密码时提示could not validate asmsnmp password ora-12541:no listener的问题
- 静态监听
- 随机密码
- "vector iterators incompatible"及一些感想
- 在vc++中用Accelerator建立一些快捷键