SQLTeam.com | Weblogs | Forums

Sum of the count column

HI All,

I have below Query and need to get the sum of the "count" column? looks like the [Total counts/User], column count is not right in this case I should get total count of 25 not 19.
Thanks!
Pasi

select
count(c.modified_by) over (partition by ndc_id ) as count,
sum(count(medication_name))over (partition by c.created_by) as [Total counts/User],
from medication.

medicaton_name =varchar (70)
ndc_id=char(11)
meds_count

please provide your data sample not as an image but as real DDL and DML

declare @p table(x int)

insert into @p