Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 24 Nov 2011 @ 11:24:50 GMT


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


Subj:   Re: Sum of distinct counts from three different tables
 
From:   Shashank.Jain

This is a very crude way of doing it but this will give you result for sure.

     SELECT SUM(CC)
     FROM
     (
     SELECT 'A', COUNT(*) CC
     FROM A
     UNION
     SELECT 'B',COUNT(*) CC
     FROM B
     UNION
     SELECT 'C', COUNT(*) CC
     FROM C
     ) TOTAL ;

Thanks

Shashank



     
  <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