Archives of the TeradataForum
Message Posted: Sun, 17 Oct 2004 @ 10:26:17 GMT
Subj: | | Re: Can this query be written more efficient |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Wednesday, October 13, 2004 09:59 -->
The two tables have the same structures and same PIs. Only columns X and Y are the same, so the union does not work, as it duplicates all the
mtable rows. I need any rows in table that also has a row in mtable with the same X and Y to be excluded from table and be inserted from mtable
into table_copy.
table:
-------
X Y newcol
1 c table
2 c table
3 c table
4 c table
5 c table
6 c table
7 c table
8 c table
9 c table
mtable:
-----------
X Y newcol
1 c mtable
2 c mtable
3 c mtable
table_copy needs to look as follows:
-------------------------------------
X Y newcol
1 c mtable
2 c mtable
3 c mtable
4 c table
5 c table
6 c table
7 c table
8 c table
9 c table
Thanks...
|