Date: Mon, 25 Aug 2008 08:35:52 +0100
Reply-To: cherish k <hawks_cherish@YAHOO.CO.IN>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: cherish k <hawks_cherish@YAHOO.CO.IN>
Subject: SQL question
Content-Type: text/plain; charset=utf-8
Hi All,
Can somebody explain if there is any difference the two SQL codes.
select * from TABLE_A where IC not in (select IC from TABLE_B)
select * from TABLE_A a where a.IC not in (select b.IC from TABLE_B where a.IC = b.IC)
I expected both the codes to be same. But output from the first table gave 0 records whereas from the second code few records came up and the second code is correct.
I ran the code in Oracle SQL. In SAS both codes performe the same (i tested on a random sample), does it work differently in SQL?
Cherish
---------------------------------
Connect with friends all over the world. Get Yahoo! India Messenger.