|
Archives of the TeradataForumMessage Posted: Wed, 23 Jan 2003 @ 00:30:28 GMT
Dave, You have M1 P1 ABC in two rows - 1 distinct set of values That's three distinct sets of values. DISTINCT applies to all columns of the query until V2R5, at which time you will have the opportunity to select multiple distinct counts within a single select statement. Now, if what you want is the number of distinct Countx values you have by Mode and Plant, you could do something like: sel tmp1.md, tmp1.pl, count(*) The result would be: M1 P1 1 - the set consists of M1 P1 ABC after the group by in the derived table M2 P2 2 - the set consists of M2 P2 ABC, and M2 P2 DEF in the derived table Thus the counts 1 and 2 for the group M1 P1 and M2 P2 respectively. Sam Mosley
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||