Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 12 Feb 2007 @ 13:57:39 GMT


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


Subj:   Update with left outer join
 
From:   prahlad.patidar

Dear Forum Users,

I want to avoid following NOT IN clause in an SQL as the subquery would make sure that any statistics on tab2 are not used and that might slow down the performance.

     update tab1
     set col1 = 999
     where col1 not in (sel col1 from tab2)

Instead is there any way to achieve the same with LEFT OUTER JOIN in following way ....

This query is obviously not working :

     update tab1 a
     set col1 = 999
     left outer join tab2 b
     on a.col1 = b.col1
     where b.col1 is null.

Could anyone please give me some idea as to how to make above query efficient.

Thanks a lot in anticipation.


Warm regards

Prahlad



     
  <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