total count and count

Database
The Teradata Database channel includes discussions around advanced Teradata features such as high-performance parallel database technology, the optimizer, mixed workload management solutions, and other related technologies.
Enthusiast

total count and count

Hi All,

 

I have a report like

 

I reject count i get based on rej id . . how can this be done . .can someone help

 

id    total count  rejected count  rej id

101   50           2                         rej01

101    50          5                         rej02

102    100        3                         rej01

102     100       4                         rej05 

 

 

1 REPLY
Junior Contributor

Re: total count and count

It's hard to understand what you want, but it might be a Group Sum:

SUM(rejected_count) OVER (PARTITION BY id) AS total_count