Welcome to SQL Team !!There are 3 Methods to do so Method 1--> Using In Query select * from tempcustomer t1 where code not in( select code from customer t2 where t1.code2 =t2.code )
Method 2 --Using Exists Query select * from tempcustomer t1 where Not Exists ( select 1 from customer t2 where t1.code2 =t2.code2 And t1.Code1 = t2.Code1 )
Method 3 --using Left outer Join select * from tempcustomer t1 Left outer Join customer t2 On t1.code2 =t2.code2 And t1.Code1 = t2.Code1 where t2.Code1 is null and t2.code2 is null
Well Choice is yours.. but i think Exists should be fastest among this.. Chiraghttp://chirikworld.blogspot.com/