Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 12 Jun 2003 @ 17:36:18 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: What's up with NOT IN?
 
From:   Michael Larkins

Hi Peter:

I am betting that the reason your NOT IN doesn't work is due to the data and the way you wrote the request. It would appear that one of your vendor_id columns contains a NULL. If you get a NULL in the subquery, the comparison result is UNKNOWN on every row that is not one of the other values in the subquery.

Therefore, the suggested NOT EXISTS will work well and probably faster than a NOT IN. To make the NOT IN work, you must add to your WHERE clause: VENDOR_ID IS NOT NULL.

Once you do this, the NOT IN will return the correct result too.


Regards,

Mike



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023