Simple SQL request - I must be missing something obvious...

From: Syltrem <syltremzulu_at_videotron.ca>
Date: Fri, 26 Nov 2010 17:01:50 -0500
Message-ID: <k7WHo.416171$De6.377781_at_en-nntp-01.dc1.easynews.com>



Hello

It must be an obvious thing I can't see because it's late Friday afternoon...

Why does the last request return nothing ?

SQL> insert into ifa_security (PROGRAM_NAME) values ('TEST');

1 ligne créée.

SQL> select PROGRAM_NAME from ifa_security where PROGRAM_NAME = 'TEST';

PROGRAM_NAME



TEST 1 ligne sélectionnée.

SQL> select PROGRAM_NAME from ifa_security where DML_CALLED = 'TEST';

aucune ligne sélectionnée

SQL> select PROGRAM_NAME from ifa_security where PROGRAM_NAME not in (select DML_CALLED from ifa_security);

aucune ligne sélectionnée

SQL> On the other hand,

SQL> select PROGRAM_NAME from ifa_security a where not exists (select 1 from ifa_security where DML_CALLED = a.PROGRAM_NAME);

PROGRAM_NAME



TEST 1 ligne(s) sélectionnée(s).

What's wrong with the NOT IN ?

Thank you !
Syltrem Received on Fri Nov 26 2010 - 16:01:50 CST

Original text of this message