Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 20 Oct 2005 @ 09:21:05 GMT


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


Subj:   Re: UNION or UNION ALL
 
From:   McCall, Glenn David

I am not sure that that is the correct question. I would refer you to the UNION Operator in the "SQL Reference: Functions and Operators" manual.

The UNION operator without the optional "ALL" keyword will remove duplicate rows from the final result set. If you include the "ALL" keyword, any duplicate rows from the two (or more) parts of the query will be returned.

You can see the difference with something like this:

     Select 1 from dbc.dbcinfo
     Union all
     Select 1 from dbc.dbcinfo;

As shown the query will return 4 rows. Delete the ALL and run it to get just 1 row.

I hope this helps

Glenn Mc



     
  <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