|
|
Archives of the TeradataForum
Message Posted: Thu, 26 Jun 2003 @ 19:54:05 GMT
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
| |