Dear all,
I know that we could insert data from a table to another table by
insert into A(F1,F2) select F1,F2 from B;
However, it seems that DB2 doesn't have insert update for this kind of
statement (i.e. The insertion failed if primary key already exist in A,
while we could do this in import statement)
Is that I missed something from the manuel? The work around I think of
is to delete the records beforehand, could anyone tell me whether this
could be done in the same statement?
Thanks in advance!
Henry
mike - 12 Jul 2006 08:40 GMT
Consider " Insert into...select ... from... where not exists ...."
or the MERGE statement might help you, if available on your platform
and version.
Gert van der Kooij - 12 Jul 2006 08:46 GMT
> Dear all,
>
[quoted text clipped - 13 lines]
>
> Henry
Check the MERGE statement at http://tinyurl.com/o2hxe