I have this query that will return correctly the values that are part of the IN
clause, but when I change it to NOT IN
, it does not return anything.
Does anyone have any suggestions?
select distinct
CAST( w.work_area AS CHAR(4) ) || s.code_id as WATT
from
sys_code s,
work_area_master w
where
s.code_type = '590'
and (
CAST( w.work_area AS CHAR(4)) || s.code_id
)
in (
select substr(misc_flags, 1,6)
from sys_code where code_type = 'STA'
);