Archives of the TeradataForum
Message Posted: Wed, 13 Oct 2004 @ 11:04:12 GMT
Subj: | | Can this query be written more efficient |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Tuesday, October 12, 2004 09:03 -->
Basically trying to insert into a copy tables all rows from table (except the ones that exist in mtable) + insert into table copy all the rows
from mtable.
INSERT INTO table_copy
SELECT *
FROM table
WHERE (X,Y) NOT IN (SELECT DISTINCT X,Y
FROM Mtable)
;insert into table_copy
select *
from Mtable;
Can this query be written in a more efficient manner. It currently takes 4 hours with table, 61+ millions rows and mtable, 20+ thousands
rows.
Thanks
|