【发布时间】:2018-02-12 16:06:54
【问题描述】:
我有一张要拆分的表。
原始表有 1,390k 行,我想使用三个条件 A、B 和 C 来拆分表。
此查询返回 60k 行
sel stuff
from table
where ( A and C)
and (B and C)
此查询返回 1,060k 行:
sel stuff
from table
where not ( A and C)
and not (B and C)
我的问题是为什么第二个查询返回 1,060k 行,而不是我预期的 1,330k?
【问题讨论】:
-
如果
where not ( ( A and C) and (B and C)) -
任何空值?
-
@JaydipJ 这个逻辑没有返回任何东西。
-
@jarlh 不,数据中没有空值。
-
create table tb (a boolean, b boolean, c boolean)添加数据(所有 8 种组合)。试试你的查询!