Archives of the TeradataForum
Message Posted: Mon, 12 Feb 2007 @ 13:57:39 GMT
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.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|