Archives of the TeradataForum
Message Posted: Wed, 22 Jan 2003 @ 23:38:24 GMT
Subj: | | Distinct count problem |
|
From: | | Dev a p |
Data
Mode Plant Countx
M1 P1 ABC
M1 P1 ABC
M2 P2 ABC
M2 P2 DEF
Select Mode, Plant , Count( Distinct (Countx)))
From Test
Group by 1,2
Result
Mode Plant Countx
M1 P1 1
M2 P2 1
M2 P2 1
but We have only two distinct countx, So I was expecting something like
Mode Plant Countx
M1 P1 1
M2 P2 1
Duplicated Countx(ABC) should in not counted again.
I am not sure how to get this. Appreciate your help.
Thanks,
|