假设我有这张桌子:
sett_tb_plant_trans
(pk)uidplanttrans field1 stoptime
---------------------------------
x 1 1/1/2000
y 1 null
z 2 1/1/2000
k 2 1/1/2000
v 3 null
j 4 null
我想选择只是因为它们填充了所有行,z并且field1 具有相同的“键”。kstoptime
我做了这个查询:
select
field1 from sett_tb_plant_trans
where uidplanttrans not in
(select uidplanttrans from sett_tb_plant_trans where stoptime is null)
但返回一些field1 有一些为stoptime空的行
为什么?