SELECT
        A,b,c,d
FROM
        tbl1
WHERE
        A NOT IN (SELECT distinct A from tbl2)


Or you could:

SELECT
        A.a,
        A.b,
        A.c,
        A.d
FROM
        tbl1 A EXCEPTION JOIN tbl2 B ON A.a = B.a

This would return any non-matching records where tbl1.A has no matching
tbl2.A 


Chris Peterson
Gainey IT
Adobe Certified Advanced Coldfusion Developer

-----Original Message-----
From: Tim Do [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 09, 2007 2:37 PM
To: CF-Talk
Subject: OT: sql not in

how do I return values from tbl1 where values are NOT in tbl2.  

 

tbl1

a,b,c,d

 

tbl2

a,b,c,d

 

only a is passed in.  b,c,d are unique.  tbls do not have identity
fields.

 

thanks,

tim

 

 

 

 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285874
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to