select distinct cat2 from item2 where (cat1 = ‘201162107’ and (cat4 not in (‘201369201’, ‘201338216’, ‘201345916’, ‘201377008’, ‘201331715’, ‘201369301’, ‘201374901’, ‘201384606’, ‘201374807’, ‘201384310’, ‘201369401’, ‘201369101’, ‘201367403’, ‘201365102’, ‘201369501’, ‘201364903’))) and time = ‘2024-01-01’;
sql中带有not in的条件,会将cat4为空的全部过滤掉查不出来,不知道是什么情况
任何字段加上 not in的过滤条件会将值为null的全部都过滤掉