Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 14 Dec 2006 @ 16:54:52 GMT


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


Subj:   Re: Avoiding distinct in grouping
 
From:   Stone, Randall

Try a union. Select only the ID and TRXN_ID fields, and then union to itself:

     Select count(*)
     >From (select ID, TRXN_ID
        From txn_detail
        UNION
        select ID, TRXN_ID
        From txn_detail);

The union command will eliminate all dupes and the count(*) command will tell you how many unique rows you have.



     
  <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