Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 26 Jun 2003 @ 19:54:05 GMT


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


Subj:   Re: Question about HASHROW
 
From:   Dieter N�th

Fuller, Joe wrote:

SELECT COUNT(*)
  FROM (SELECT CH.ACCESS_METHOD_ID
              ,CH.CALL_START_DT
              ,CH.CALL_START_TM
              ,CH.CALL_ORIGINATING_NUM
              ,COUNT(*) AS MYCOUNT
         FROM BI_DWV.CALL_HIST AS CH
        GROUP BY CH.ACCESS_METHOD_ID
                ,CH.CALL_START_DT
                ,CH.CALL_START_TM
                ,CH.CALL_ORIGINATING_NUM
       HAVING COUNT(*) > 1) AS T

        Count(*)
        21

You're calculating the combinations with more than 1 row/value, but not the number of rows. Maybe there are hundreds of rows with the same combination.

Try a

SELECT SUM(MYCOUNT)
   FROM (SELECT COUNT(*) AS MYCOUNT
          FROM BI_DWV.CALL_HIST AS CH
         GROUP BY CH.ACCESS_METHOD_ID
                 ,CH.CALL_START_DT
                 ,CH.CALL_START_TM
                 ,CH.CALL_ORIGINATING_NUM
        HAVING COUNT(*) > 1) AS T

Dieter



     
  <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