|
|
Archives of the TeradataForum
Message Posted: Wed, 16 Nov 2005 @ 18:06:46 GMT
Subj: | | Re: UPDATE vs DELETE-INSERT |
|
From: | | Micheletto, David |
If table1 is the target of many(?) updates, perhaps an insert select like the following might work better? (check the logic out carefully)
INSERT newtable
SELECT a.col1, a.col2,
case when b.col1 is null then a.col3
else b.col3 end,
case when b.col1 is null then a.col4
else b.col4 end
from table1 a left join table2 b
on a.col1 = b.col1
and a.col2 = b.col2
David L. Micheletto
Senior Instructor
Teradata Certified Master
| |