Can you please help advise about not exists and not in?
Hi expert,
I would like to know how difference between "NOT EXISTS" and "NOT IN". I have to fix some script from old DBA had been setup for monitoring db.
===Below is machine name connect to testdb
SQL> select distinct userhost from dba_audit_trail;
USERHOST
--------------------------------------------------------------------------------
WORKGROUP\NUMNIMJUN-PC
racnode2
racnode1
===Below is list of allowed server keep in b table.
SQL> select * from b;
MACHINE
--------------------------------------------------------------------------------
WORKGROUP\NUMNIMJUN-PC
racnode2
===Assume we not allow racnode1 to connect db.
from the old script they used like this:
SQL> select distinct userhost from dba_audit_trail
2 where not exists (select machine from b);
0