![]() |
|
Archives of the TeradataForumMessage Posted: Fri, 04 Feb 2011 @ 08:57:50 GMT
Hi, You can do it with partition clause, here is the syntax
sel c1,sum(c2),count(c3),count(c4) over(partition by c1 order by 1)
from vt1 group by c1,c4;
The output will be same as your sql
sel c1,sum(c2),count(c3),count(distinct c4) from vt1 group by c1
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||