|  |  | 
|  |  | Archives of the TeradataForumMessage Posted: Tue, 15 Aug 2006 @ 18:20:52 GMT
 
 Oops ... Just after I sent my reply I noticed that in the Subject line you wanted to avoid the GROUP BY. My solution will not work. Just out of interest: why this restriction? The formal alternative (I call it formal because although it does not use GROUP BY I doubt it is a practical alternative to the GROUP BY) is to use the window versions of MAX and COUNT. 
     sel COL_A as Product, COUNT(COL_B) OVER(PARTITION BY COL_A ROWS BETWEEN
     UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) as Total from the_table
and then perhaps apply the same trick you used with the MAX. If you have a special reason to do this, of course. Victor 
 | ||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||
| 
 | ||||||||||||||||||||||||||||||||||||||||||||||||
|   | ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||