剛剛發現個數據問題,排查了下,結果又是oracle的坑,記錄下
這次是關于not in
的問題
select *from
from v_xy_new_small_b a
where a.user_code not in (select user_code from v_xy_meigu_and_empployee)
我就是想剔除下重復的用戶,結果發現,今天查不出數據了,昨天還是正常的,找了半圈,發現是Oracle的一些特性
如果這個子查詢中,結果中有NULL值,那就會返回空結果集
后來一看的確是我的v_xy_meigu_and_empployee中有user-code為空的記錄,
修改下:
select *from
from v_xy_new_small_b a
where a.user_code not in (select user_code from v_xy_meigu_and_empployee where user_code is not null)