LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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.


Back to: Top of message | Previous page | Main SAS-L page