Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 13 Oct 2004 @ 11:47:00 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Can this query be written more efficient
 
From:   David Clough

Narayan writes:

  You are trying to achieve something like {(A-B) U B }, which is similar to just {A U B}.  


  So I guess you could use:  


          Insert into table_copy
          Sel * from table
          Union
          Sel * from mtable;

This method assumes that ALL columns on mtable = ALL columns on table, whereas it might be - John can confirm one way of the other - that only X & Y are the same (and therefore that row is not needed)

Otherwise, yes, much neater.


Dave Clough
Database Designer
Database Design Group



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023