Hi,

I need to optimize a SQL query which does an anti-join on one table.

select A from table_t
where A not in
(select distinct A from table_t
where B in ('ABC','DEF') and C ='LS')

I read about using NOT EXISTS in place of NOT IN but i can't seem to implement it into my query as the examples shown uses anti-join on 2 tables.

Is there a way to optimize an anti-join on one table? Will appreciate it if you can show me a link or so.

Thanks a lot!